Search code examples
c++qtruntimestandby

Measure actual runtime of a procedure using Qt


I want to measure the runtime of a procedure that will last multiple days. This means the executing process will be interrupted many times since the Linux PC will be suspended to standby repeatedly. I don't want to include those sleep phases in my time measurement so I can't use simple time stamps.

Is there a better way to measure the net runtime of a procedure other than firing a QTimer every second and counting those timeouts?


Solution

  • As G.M. proposed, I used boost::timer::cpu_timer time to solve my issue. It returns the summed up computation time and the run time of the entire process which is fine for my purpose. Boost is not Qt but it is cross-platform anyway.