You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #pragma once
- //精确计时 微秒级别
-
- class CTimer
- {
- public:
- CTimer()
- {
- QueryPerformanceFrequency(&m_Frequency);
- Start();
- }
- ~CTimer();
-
- void Start()
- {
- QueryPerformanceCounter(&m_StartCount);
- }
- double End()
- {
- LARGE_INTEGER CurrentCount;
- QueryPerformanceCounter(&CurrentCount);
- return double(CurrentCount.LowPart - m_StartCount.LowPart) / (double)m_Frequency.LowPart;
- }
- private:
- LARGE_INTEGER m_Frequency;
- LARGE_INTEGER m_StartCount;
- };
-
|