Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LARGE_INTEGER li;
- Double frequency;
- Double time;
- HRESULT hresult;
- // Get the high-resolution timer frequency
- hresult = QueryPerformanceFrequency(&li);
- if(!hresult) { return false; }
- // Set the timer frequency to milliseconds
- frequency = (double)li.QuadPart / 1000.0;
- // Reset the timer
- QueryPerformanceCounter(&li);
- time = li.QuadPart;
- // Stuff goes here
- // Get the elasped time
- QueryPerformanceCounter(&li);
- time = li.QuadPart - time;
- time /= frequency;
- // Time stuff goes here
- // Reset the timer
- QueryPerformanceCounter(&li);
- time = li.QuadPart;
- // Go back to the stuff goes here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement