Ejemplo n.º 1
0
void Timer::stopTimer() {
  Time += TimeRecord::getCurrentTime(false);

  if (ActiveTimers->back() == this) {
    ActiveTimers->pop_back();
  } else {
    std::vector<Timer*>::iterator I =
      std::find(ActiveTimers->begin(), ActiveTimers->end(), this);
    assert(I != ActiveTimers->end() && "stop but no startTimer?");
    ActiveTimers->erase(I);
  }
}
Ejemplo n.º 2
0
void Timer::stopTimer() {
    sys::SmartScopedLock<true> L(*TimerLock);
    TimeRecord TR = getTimeRecord(false);
    Elapsed    += TR.Elapsed;
    UserTime   += TR.UserTime;
    SystemTime += TR.SystemTime;
    MemUsed    += TR.MemUsed;

    if (ActiveTimers->back() == this) {
        ActiveTimers->pop_back();
    } else {
        std::vector<Timer*>::iterator I =
            std::find(ActiveTimers->begin(), ActiveTimers->end(), this);
        assert(I != ActiveTimers->end() && "stop but no startTimer?");
        ActiveTimers->erase(I);
    }
}