ggadget/tests/mocked_timer_main_loop.h
// Explicitly advance the current time.
Explicitly advance the current time.
Explicitly advance the current time .
void AdvanceTime(int time) {
    current_time_ += time;
    int size = static_cast<int>(timers_.size());
    for (int i = 0; i < size; i++) {
      TimerInfo *info = &timers_[i];
      if (info->interval != -1) {
        info->remaining -= time;
        if (info->remaining <= 0) {
          LOG("MockedTimerMainLoop fire timer: %d id=%d", info->interval, i);
          if (!info->callback->Call(this, i))
            RemoveWatch(i);
          else
            info->remaining = info->interval;
        }
      }
    }
  }
void AdvanceTime ( int time ) { current_time_ += time ; int size = static_cast < int > ( timers_ . size ( ) ) ; for ( int i = 0 ; i < size ; i ++ ) { TimerInfo * info = & timers_ [ i ] ; if ( info -> interval != -1 ) { info -> remaining -= time ; if ( info -> remaining <= 0 ) { LOG ( " " , info -> interval , i ) ; if ( ! info -> callback -> Call ( this , i ) ) RemoveWatch ( i ) ; else info -> remaining = info -> interval ; } } } }
Explicitly advance the current time.
Explicitly advance the current time .