Skip to content

Improve the timer class

Mark de Wever requested to merge ast-625-improve-timer into master

Use std::chrono::steady_clock instead of evaluating the CPU timers. This leads to a more accurate clock and portable code.

It would be possible to change returned durations to use the clock's duration type. However that would require changing all callers, instead it still returns a double to be a drop in replacement.

Some minor janitorial changes:

  • Make all members variables private
  • Use consistent naming for member variables
  • Remove the declaration of print_time since it's not defined
  • Replace unsigned long long with uint64_t
Edited by Mark de Wever

Merge request reports