timing a function
I am looking for a way to time how long a set of function take to perform there actions. What is the best what of doing this?
is there something a little simple to inplement, like a function. i am using time() but is there something that give me like milli-seconds?
Here's something for you to take a look at [wink]. It uses the most accurate timer avaliable on Windows.
void WINAPI GetCycleCount(ULARGE_INTEGER &ulCycleCount){ __asm { push ecx rdtsc mov ecx, ulCycleCount mov DWORD PTR[ecx], eax mov DWORD PTR[ecx+4], edx pop ecx } }
That gives you the CPU cycle counter. Should be accurate to within 20 cycles.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement