[API] Timer-start behavior (bug)fix

Only start the timer when it is not running currently. In old behavior
the current slice-time was discarded, now multiple starts have no
effect.
pull/552/head
Sissors 2014-10-10 21:25:09 +02:00
parent 1b833cbd67
commit 0ea849e7ff
1 changed files with 4 additions and 2 deletions

View File

@ -23,8 +23,10 @@ Timer::Timer() : _running(), _start(), _time() {
} }
void Timer::start() { void Timer::start() {
_start = us_ticker_read(); if (!_running) {
_running = 1; _start = us_ticker_read();
_running = 1;
}
} }
void Timer::stop() { void Timer::stop() {