Comparing outputs from QueryPerformanceCounter() of windows.h, clock() of time.h and time() of time.h

Experiment done with Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200)

A normal debug run:

QueryPerformanceCounter(): ticks elapsed: 7945650
QueryPerformanceCounter(): QueryPerformanceFrequency(): 3579545
QueryPerformanceCounter(): time elapsed: 2.21974
clock(): ticks elapsed: 2263
clock(): CLOCKS_PER_SEC: 1000
clock(): time elapsed: 2.263
time(): time elapsed: 3
Stopped at a breakpoint for about 40 seconds before continuing:
QueryPerformanceCounter(): ticks elapsed: 151086932
QueryPerformanceCounter(): QueryPerformanceFrequency(): 3579545
QueryPerformanceCounter(): time elapsed: 42.2084
clock(): ticks elapsed: 42331
clock(): CLOCKS_PER_SEC: 1000
clock(): time elapsed: 42.331
time(): time elapsed: 43

No comments

Post a comment

RSS