📄 time.c
字号:
/*
File: Timer.h
To provide timer interrupt callback and sleep functions.
*/
#include "timer.h"
static volatile int ms_ctr = 0;
// Timer interrupt callback
void TimerBeat(void)
{
// Called at 1000 Hz rate.
ms_ctr++; // Sleep counter.
}
void Sleep(int milliseconds)
{
ms_ctr = 0;
while (ms_ctr < milliseconds) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -