Does clock_gettime function use tsc for timing?
Hi, everyone.
I need to measure time precisely and intend to use clock_gettime function. It's said that clock_gettime function uses TSC for timing, and TSC increments is constant relative to CPU clock. However, the CPU clock may be scaled back for power saving, which may leads to a relative change in the TSC increments. Does this mean that the time clock_gettime function gives may not be precise? Thanks:) |
it uses the actual clock, not tsc
it may be inaccurate due to the time to do the system call and whatnot CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW are vdso-s and dont do some special conversions so they are more accurate |
Quote:
|
All times are GMT -5. The time now is 10:05 PM. |