when wanting high precision timing in C++ on linux use time.h and do
timespec timestamp;
clock_timeofday(CLOCK_REALTIME,×tamp);
It is unknown where CLOCK_REALTIME is defined but the computer didn’t seem to complain.
And remember to link agains librt.so
Tags: c++ timing linux ubuntu