📄 timer.h
字号:
/* Timer.h
*
* Accurate timing.
*
* #define one of the following values to select the appropriate code
* based on your microcontroller and desired Timer/Counter (T/C) usage.
*
* define T/C
* --------- ---
* TIMER_0 0
* TIMER_2 2
*
* Valid combinations:
*
* ATmega CLOCK_ T/C
* ------ ------- ----
* 8 8M, 16M 2
* 16, 32 8M 0, 2
* 16M 2
* 644 8M 0, 2
* 16M 2
* 128 8M 0, 2
* 16M 0
*
* Revisions:
* 07-13-06 included in LCDSample project
* 07-05-06 version 1 in master library
*
* Written by Cathy Saxton
* robotics@idleloop.com
*/
#pragma once
class TIMER
{
public:
/* constructor for initializing Timer/Counter for timing */
TIMER();
/* returns number of ms since Timer initialized */
ulong MsCur() const;
/* returns true if the specified number of milliseconds
has passed since the start time (else returns false) */
bool FElapsed(ulong msStart, ulong msWait) const;
/* pauses (waits) for the specified number of milliseconds */
void WaitMs(uint ms) const;
private:
static void Init();
/* static variable: one per class, not instance */
static bool s_fInit;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -