4

Looking at boost::timer::cpu_timer definition, I see that it doesn't seem to have any way to restart the timer. Is restarting a cpu_timer can only be done by recreating the timer object, or is there something I'm missing.

Elektito
  • 3,863
  • 8
  • 42
  • 72
  • doesn't resume method do what you need? http://www.boost.org/doc/libs/1_55_0/libs/timer/doc/cpu_timers.html#resume – Vladimir Jun 02 '14 at 11:41
  • resume continues accumulating time, but it doesn't clear the already accumulated time. Or so it sounds to me. – Elektito Jun 02 '14 at 11:42
  • 2
    what about `start()`? As I read the docs it seems to me that it resets the timer. (There would be no need for restart otherwise) – Csq Jun 02 '14 at 11:49
  • 1
    Huh! Hadn't thought of that! Tested it, and it seems you're right. Stupid of me! :) – Elektito Jun 02 '14 at 11:54
  • @Elektito ok, I posted it as an answer then :) – Csq Jun 02 '14 at 12:02

1 Answers1

7

start() restarts the timer, that's why there's no need for a restart() function.

Gaspa79
  • 5,488
  • 4
  • 40
  • 63
Csq
  • 5,775
  • 6
  • 26
  • 39