?? msectimer.cpp
字號(hào):
/**
@file
Code for a timer with a resolution of one milisecond.
*/
#include "MSecTimer.h"
#include "../lib/WinException.h"
using namespace Othello;
MSecTimer::MSecTimer()
{
LARGE_INTEGER freq=_htimer.Frequency();
if(freq.QuadPart<1000)
throw Win::Exception("Hardware does not support a timer with resolution of atleast 1 ms");
}
unsigned int MSecTimer::Time()
{
LARGE_INTEGER ticks=_htimer.Ticks();
LARGE_INTEGER freq=_htimer.Frequency();
return static_cast<unsigned int>(1000*(ticks.QuadPart/freq.QuadPart))+1;
}
void MSecTimer::ReInit()
{
_htimer.InitBase();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -