I also recommend the tools offered by Boost. Either the mentioned Boost Timer, or hack something out of Boost.DateTime or there is new proposed library in the sandbox - Boost.Chrono: This last one will be a replacement for the Timer and will feature:
duration
time_point
system_clock
monotonic_clock
high_resolution_clock
timer
, with typedefs:
system_timer
monotonic_timer
high_resolution_timer
process_clock
, capturing real, user-CPU, and system-CPU times.process_timer
, capturing elapsed real, user-CPU, and system-CPU times.run_timer
, convenient reporting of |process_timer| results.Here is the source of the feature list