?? timer.h
字號(hào):
// file timer.h//created by alpha 2008.11.15#ifndef TIMER_H#define TIMER_H#include <windows.h>class Timer{private: int _freq; LARGE_INTEGER _begin; LARGE_INTEGER _end;public: long costTime; // 花費(fèi)的時(shí)間(精確到微秒)public: Timer() { LARGE_INTEGER tmp; QueryPerformanceFrequency(&tmp); _freq = tmp.QuadPart; costTime = 0; } void Start() // 開始計(jì)時(shí) { QueryPerformanceCounter(&_begin); } void End() // 結(jié)束計(jì)時(shí) { QueryPerformanceCounter(&_end); costTime = (long)((_end.QuadPart - _begin.QuadPart) * 1000000 / _freq); } void Reset() // 計(jì)時(shí)清0 { costTime = 0; }};#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -