Classes | |
class | Alarm |
struct | CompareAlarms |
Public Member Functions | |
MockTimer (int64 time_ms) | |
void | SetTimeUs (int64 new_time_us) |
void | SetTimeMs (int64 new_time_ms) |
void | AdvanceUs (int64 delta_us) |
Advance forward time by the specified number of microseconds. | |
void | AdvanceMs (int64 delta_ms) |
Advance time, in milliseconds. | |
virtual int64 | NowUs () const |
Returns number of microseconds since 1970. | |
virtual void | SleepUs (int64 us) |
Sleep for given number of microseconds. | |
virtual void | SleepMs (int64 ms) |
Sleep for given number of milliseconds. | |
Alarm * | AddAlarm (int64 wakeup_time_us, Function *alarm) |
void | CancelAlarm (Alarm *alarm) |
Cancels an outstanding alarm and deletes it. | |
void | set_mutex (AbstractMutex *mutex) |
Static Public Attributes | |
static const int64 | kApr_5_2010_ms |
A useful recent time-constant for testing. |
Schedules an alarm, called when the time is advanced to, or beyond, alarm->wakeup_time_us(). Takes ownership of Alarm: it will be deleted when it's finished.
Returns the Alarm* so it can be canceled, or NULL if the alarm was called immediately due to the wakeup_time already being reached.
void net_instaweb::MockTimer::set_mutex | ( | AbstractMutex * | mutex | ) | [inline] |
void net_instaweb::MockTimer::SetTimeUs | ( | int64 | new_time_us | ) |
Sets the time as in microseconds, calling any outstanding alarms with wakeup times up to and including time_us.