linux high performance timer

Started by
1 comment, last by krumms 21 years, 4 months ago
Hi guys, Just wondering if there''s something similar to QueryPerformanceCounter/QueryPerformanceFrequency generally supported by the Linux platform? I''ve looked into the RDTSC instruction, but would like to steer away from x86 specific stuff if possible. Regards, Tom L
refrain_from_stupidity( &me );
Advertisement
The traditional *NIX timing function is gettimeofday, with a potential nanosecond accuracy.

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | Free C++ IDE. ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Boost C++ Lib ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Other functions you might be interested in are clock_gettime (potential nanosecond accuracy; standard POSIX, but relatively new) and ftime (millisecond accuracy; standard POSIX).

The gettimeofday function that Fruny mentioned is standard for BSD (but supported in Linux and many BSD derived unixes), if you''re interested.

This topic is closed to new replies.

Advertisement