Archived

This topic is now archived and is closed to further replies.

Lupin

QPC timer problem

Recommended Posts

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

Share this post


Link to post
Share on other sites