|
reSIProcate/rutil
9694
|
This class is used to get the current system time. More...
#include <Timer.hxx>
Public Types | |
| enum | Type { TimerA, TimerB, TimerC, TimerD, TimerE1, TimerE2, TimerF, TimerG, TimerH, TimerI, TimerJ, TimerK, TimerTrying, TimerStaleClient, TimerStaleServer, TimerStateless, TimerCleanUp, ApplicationTimer } |
Public Member Functions | |
| RESIP_HeapCount (Timer) | |
Static Public Member Functions | |
| static Data | toData (Type timer) |
| static void | setupTimeOffsets () |
| static UInt64 | getTimeMicroSec () |
| Returns the current clock time in microseconds. | |
| static UInt64 | getTimeMs () |
| Returns the current clock time in milliseconds. | |
| static UInt64 | getTimeSecs () |
| Returns the current clock time in seconds. | |
| static UInt64 | getRandomFutureTimeMs (UInt64 futureMs) |
| Returns an absolute time in ms that is between 50% and 90% of passed in ms from now. | |
| static UInt64 | getForever () |
| Infinit time in future. | |
| static unsigned | getMaxSystemTimeWaitMs (void) |
| On windows, change getSystemTime() to not use the actual clock time returned by ::GetSystemTime(). | |
| static void | resetT1 (unsigned long t1) |
Static Public Attributes | |
| static unsigned long | T1 = 500 |
| static unsigned long | T2 = 8 * T1 |
| static unsigned long | T4 = 10 * T1 |
| static unsigned long | T100 = 80 |
| static unsigned long | TB = 64*T1 |
| static unsigned long | TC = 3*60*1000 |
| static unsigned long | TF = 64*T1 |
| static unsigned long | TH = 64*T1 |
| static unsigned long | TD = 32000 |
| static unsigned long | TS = 32000 |
This class is used to get the current system time.
| enum resip::Timer::Type |
| TimerA | |
| TimerB | |
| TimerC | |
| TimerD | |
| TimerE1 | |
| TimerE2 | |
| TimerF | |
| TimerG | |
| TimerH | |
| TimerI | |
| TimerJ | |
| TimerK | |
| TimerTrying | |
| TimerStaleClient | |
| TimerStaleServer | |
| TimerStateless | |
| TimerCleanUp | |
| ApplicationTimer |
Definition at line 28 of file Timer.hxx.
{
TimerA, // doubling
TimerB,
TimerC,
TimerD,
TimerE1,// doubling
TimerE2,// doubling
TimerF,
TimerG, // doubling
TimerH,
TimerI,
TimerJ,
TimerK,
TimerTrying,
TimerStaleClient,
TimerStaleServer,
TimerStateless,
TimerCleanUp,
ApplicationTimer // .dlb. Fifo, so no thread issues
} Type;
| static UInt64 resip::Timer::getForever | ( | ) | [inline, static] |
Infinit time in future.
Definition at line 84 of file Timer.hxx.
{
return ResipClock::getForever();
}
| static unsigned resip::Timer::getMaxSystemTimeWaitMs | ( | void | ) | [inline, static] |
On windows, change getSystemTime() to not use the actual clock time returned by ::GetSystemTime().
The replacement time function on some versions of windows (< Vista, GetTickCount()) returns a 32-bit value, so it will rollover at some point. Any code that waits on timers should not wait longer than this value.
Definition at line 97 of file Timer.hxx.
{
return ResipClock::getMaxSystemTimeWaitMs();
}
Returns an absolute time in ms that is between 50% and 90% of passed in ms from now.
Definition at line 78 of file Timer.hxx.
{
return ResipClock::getRandomFutureTimeMs(futureMs);
}
| static UInt64 resip::Timer::getTimeMicroSec | ( | ) | [inline, static] |
Returns the current clock time in microseconds.
Definition at line 59 of file Timer.hxx.
Referenced by resip::AbstractFifo< Timestamped< Msg * > >::onFifoPolled(), and resip::AbstractFifo< Timestamped< Msg * > >::onMessagePushed().
{
return ResipClock::getTimeMicroSec();
}
| static UInt64 resip::Timer::getTimeMs | ( | ) | [inline, static] |
Returns the current clock time in milliseconds.
Definition at line 65 of file Timer.hxx.
Referenced by resip::TransactionTimer::encode(), resip::TimerWithPayload::encode(), resip::AbstractFifo< Timestamped< Msg * > >::getMultiple(), resip::AbstractFifo< Timestamped< Msg * > >::getNext(), main(), resip::GenericTimerQueue< T >::msTillNextTimer(), Every4::thread(), Old2::thread(), and resip::Condition::wait().
{
return ResipClock::getTimeMs();
}
| static UInt64 resip::Timer::getTimeSecs | ( | ) | [inline, static] |
Returns the current clock time in seconds.
Definition at line 71 of file Timer.hxx.
Referenced by resip::RRList::encodeRecordItem(), resip::RRCache::lookup(), resip::RRList::RRList(), and resip::RRList::update().
{
return ResipClock::getTimeSecs();
}
| void Timer::resetT1 | ( | unsigned long | t1 | ) | [static] |
| resip::Timer::RESIP_HeapCount | ( | Timer | ) |
| static void resip::Timer::setupTimeOffsets | ( | ) | [inline, static] |
Does not do anything at the moment.
Definition at line 54 of file Timer.hxx.
Referenced by resip::Random::initialize().
{}
Definition at line 68 of file Timer.cxx.
References TimerA, TimerB, TimerC, TimerCleanUp, TimerD, TimerE1, TimerE2, TimerF, TimerG, TimerH, TimerI, TimerJ, TimerK, TimerStaleClient, TimerStaleServer, TimerStateless, and TimerTrying.
{
switch (timer)
{
case TimerA: // doubling
return "Timer A";
case TimerB:
return "Timer B";
case TimerC:
return "Timer C";
case TimerD:
return "Timer D";
case TimerE1:
return "Timer E1";
case TimerE2:
return "Timer E2";
case TimerF:
return "Timer F";
case TimerG:
return "Timer G";
case TimerH:
return "Timer H";
case TimerI:
return "Timer I";
case TimerJ:
return "Timer J";
case TimerK:
return "Timer K";
case TimerTrying:
return "Timer Trying";
case TimerStaleClient:
return "Timer StaleClient";
case TimerStaleServer:
return "Timer StaleServer";
case TimerStateless:
return "Timer Stateless";
case TimerCleanUp:
return "Timer Cleanup";
default:
assert(0);
}
return "Bad Bad Bad in timer";
}
unsigned long resip::Timer::T1 = 500 [static] |
unsigned long resip::Timer::T100 = 80 [static] |
unsigned long resip::Timer::T2 = 8 * T1 [static] |
unsigned long resip::Timer::T4 = 10 * T1 [static] |
unsigned long resip::Timer::TB = 64*T1 [static] |
unsigned long resip::Timer::TC = 3*60*1000 [static] |
unsigned long resip::Timer::TD = 32000 [static] |
unsigned long resip::Timer::TF = 64*T1 [static] |
unsigned long resip::Timer::TH = 64*T1 [static] |
unsigned long resip::Timer::TS = 32000 [static] |
1.7.5.1