Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
net_instaweb::MockTimer Class Reference
Inheritance diagram for net_instaweb::MockTimer:
net_instaweb::Timer

Public Types

typedef void(* Callback )(void *user_data)
 

Public Member Functions

 MockTimer (AbstractMutex *mutex, int64 time_ms)
 Takes ownership of mutex.
 
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.
 
void SetTimeDeltaUs (int64 delta_us)
 Set time advances in microseconds for the next calls to NowUs/NowMs.
 
void SetTimeDeltaUsWithCallback (int64 delta_us, Function *callback)
 
void SetTimeDeltaMs (int64 delta_ms)
 Set time advances in milliseconds for the next calls to NowUs/NowMs.
 
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.
 
- Public Member Functions inherited from net_instaweb::Timer
virtual int64 NowMs () const
 Returns number of milliseconds since 1970.
 

Static Public Attributes

static const int64 kApr_5_2010_ms
 A useful recent time-constant for testing.
 
- Static Public Attributes inherited from net_instaweb::Timer
static const int64 kSecondMs = 1000
 
static const int64 kMsUs = 1000
 
static const int64 kSecondUs = kMsUs * kSecondMs
 
static const int64 kSecondNs = 1000 * kSecondUs
 
static const int64 kMinuteMs = 60 * kSecondMs
 
static const int64 kMinuteUs = 60 * kSecondUs
 
static const int64 kHourMs = 60 * kMinuteMs
 
static const int64 kDayMs = 24 * kHourMs
 
static const int64 kWeekMs = 7 * kDayMs
 
static const int64 kMonthMs = 31 * kDayMs
 
static const int64 kYearMs = 365 * kDayMs
 

Member Function Documentation

void net_instaweb::MockTimer::SetTimeDeltaUsWithCallback ( int64  delta_us,
Function callback 
)

Set time advances in microseconds for the next calls to NowUs/NowMs, with the corresponding callback to execute right before that time is returned.

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.


The documentation for this class was generated from the following file: