reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::Timer Class Reference

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 , TcpConnectTimer
}
 

Public Member Functions

 RESIP_HeapCount (Timer)
 

Static Public Member Functions

static Data toData (Type timer)
 
static void setupTimeOffsets ()
 
static uint64_t getTimeMicroSec ()
 Returns the current clock time in microseconds.
 
static uint64_t getTimeMs ()
 Returns the current clock time in milliseconds.
 
static uint64_t getTimeSecs ()
 Returns the current clock time in seconds.
 
static uint64_t getRandomFutureTimeMs (uint64_t futureMs)
 Returns an absolute time in ms that is between 50% and 90% of passed in ms from now.
 
static uint64_t 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
 
static unsigned long TcpConnectTimeout = 0
 

Detailed Description

This class is used to get the current system time.

Note
Should we refactor this? It seems like the SIP-timer stuff should live in resip/stack somewhere.

Definition at line 30 of file Timer.hxx.

Member Enumeration Documentation

◆ Type

Enumerator
TimerA 
TimerB 
TimerC 
TimerD 
TimerE1 
TimerE2 
TimerF 
TimerG 
TimerH 
TimerI 
TimerJ 
TimerK 
TimerTrying 
TimerStaleClient 
TimerStaleServer 
TimerStateless 
TimerCleanUp 
ApplicationTimer 
TcpConnectTimer 

Definition at line 34 of file Timer.hxx.

Member Function Documentation

◆ getForever()

static uint64_t resip::Timer::getForever ( )
inlinestatic

Infinit time in future.

Definition at line 91 of file Timer.hxx.

◆ getMaxSystemTimeWaitMs()

static unsigned resip::Timer::getMaxSystemTimeWaitMs ( void  )
inlinestatic

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.

See also
resiprocate.org devlist discussion "Timers: why system time?";
resip::SipStack::getTimeTillNextProcessMS().

Definition at line 104 of file Timer.hxx.

◆ getRandomFutureTimeMs()

static uint64_t resip::Timer::getRandomFutureTimeMs ( uint64_t  futureMs)
inlinestatic

Returns an absolute time in ms that is between 50% and 90% of passed in ms from now.

Definition at line 85 of file Timer.hxx.

◆ getTimeMicroSec()

static uint64_t resip::Timer::getTimeMicroSec ( )
inlinestatic

Returns the current clock time in microseconds.

Definition at line 66 of file Timer.hxx.

◆ getTimeMs()

static uint64_t resip::Timer::getTimeMs ( )
inlinestatic

Returns the current clock time in milliseconds.

Definition at line 72 of file Timer.hxx.

◆ getTimeSecs()

static uint64_t resip::Timer::getTimeSecs ( )
inlinestatic

Returns the current clock time in seconds.

Definition at line 78 of file Timer.hxx.

◆ resetT1()

void Timer::resetT1 ( unsigned long  t1)
static

Definition at line 60 of file Timer.cxx.

◆ RESIP_HeapCount()

resip::Timer::RESIP_HeapCount ( Timer  )

◆ setupTimeOffsets()

static void resip::Timer::setupTimeOffsets ( )
inlinestatic
Deprecated:
. Does not do anything at the moment.

Definition at line 61 of file Timer.hxx.

◆ toData()

Data Timer::toData ( Type  timer)
static

Definition at line 71 of file Timer.cxx.

Member Data Documentation

◆ T1

unsigned long resip::Timer::T1 = 500
static

Definition at line 114 of file Timer.hxx.

◆ T100

unsigned long resip::Timer::T100 = 80
static

Definition at line 117 of file Timer.hxx.

◆ T2

unsigned long resip::Timer::T2 = 8 * T1
static

Definition at line 115 of file Timer.hxx.

◆ T4

unsigned long resip::Timer::T4 = 10 * T1
static

Definition at line 116 of file Timer.hxx.

◆ TB

unsigned long resip::Timer::TB = 64*T1
static

Definition at line 119 of file Timer.hxx.

◆ TC

unsigned long resip::Timer::TC = 3*60*1000
static

Definition at line 120 of file Timer.hxx.

◆ TcpConnectTimeout

unsigned long resip::Timer::TcpConnectTimeout = 0
static

Definition at line 127 of file Timer.hxx.

◆ TD

unsigned long resip::Timer::TD = 32000
static

Definition at line 124 of file Timer.hxx.

◆ TF

unsigned long resip::Timer::TF = 64*T1
static

Definition at line 121 of file Timer.hxx.

◆ TH

unsigned long resip::Timer::TH = 64*T1
static

Definition at line 122 of file Timer.hxx.

◆ TS

unsigned long resip::Timer::TS = 32000
static

Definition at line 125 of file Timer.hxx.


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