Original Post
🔒 Locked
QPC timer problem
Advertisement
At the start of your app/game get the frequency of the performance counter...
LARGE_INTEGER timerFreq;
QueryPerformanceFrequency(&timerFreq);
Then call the QueryPerformanceCounter function to obtain some values for timing... (example)
LARGE_INTEGER startTime;
LARGE_INTEGER endTime;
QueryPerformanceCounter(&startTime);
// do some stuff here...
QueryPerformanceCounter(&endTime);
double timeInSecs;
timeInSecs = (double)((double)(endTime.QuadPart - startTime.QuadPart) / (double)timerFreq.QuadPart);
timeInSecs holds the time taken (in seconds) to do the ''stuff''.
Hopefully this will help and give you a place to start from.
Regards,
Sharky
LARGE_INTEGER timerFreq;
QueryPerformanceFrequency(&timerFreq);
Then call the QueryPerformanceCounter function to obtain some values for timing... (example)
LARGE_INTEGER startTime;
LARGE_INTEGER endTime;
QueryPerformanceCounter(&startTime);
// do some stuff here...
QueryPerformanceCounter(&endTime);
double timeInSecs;
timeInSecs = (double)((double)(endTime.QuadPart - startTime.QuadPart) / (double)timerFreq.QuadPart);
timeInSecs holds the time taken (in seconds) to do the ''stuff''.
Hopefully this will help and give you a place to start from.
Regards,
Sharky
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement