update method
Implementation
void update(double dt) {
if (_running) {
_current += dt;
if (_current >= period) {
if (!repeat) {
_running = false;
_callTicker();
return;
}
// This is used to cover the rare case of _current being more than
// two times the value of period, so that the onTick is called the
// correct number of times
while (_current >= period) {
_current -= period;
_callTicker();
}
}
}
}