i*****s 发帖数: 438 | 1 Anyone knows how to make an accurate C++ timer,
one that is accurate and not susceptible to
multi-core and CPU stepping, etc.? Thanks! |
x*********h 发帖数: 25 | 2 Absolutely accurate c++ timer cannot be got at windows and linux.
In windows, try to use queryperformance*()
sorry, I cannot remember exact function name. |
i*****s 发帖数: 438 | 3
Then what is the most accurate method under Linux?
With the rdtsc instruction, we can get cycles, but
it's not working with CPU stepping.
How is gettimeofday() implemented?
【在 x*********h 的大作中提到】 : Absolutely accurate c++ timer cannot be got at windows and linux. : In windows, try to use queryperformance*() : sorry, I cannot remember exact function name.
|
p***o 发帖数: 1252 | 4 getrusage?
【在 i*****s 的大作中提到】 : : Then what is the most accurate method under Linux? : With the rdtsc instruction, we can get cycles, but : it's not working with CPU stepping. : How is gettimeofday() implemented?
|
x*********h 发帖数: 25 | |
d****2 发帖数: 6250 | 6 You can also use PAPI, using PAPI_get_real_usec. Though under linux it
requires kernel patch. |