vdr 2.7.9
cTimeMs Class Reference

#include <tools.h>

Public Member Functions

 cTimeMs (int Ms=0)
 
void Set (int Ms=0)
 
bool TimedOut (void) const
 
uint64_t Elapsed (void) const
 
uint64_t Remaining (void) const
 
void Reset (void)
 

Static Public Member Functions

static uint64_t Now (void)
 

Private Attributes

uint64_t begin
 
uint64_t end
 

Detailed Description

Definition at line 406 of file tools.h.

Constructor & Destructor Documentation

◆ cTimeMs()

cTimeMs::cTimeMs ( int Ms = 0)

Creates a timer with ms resolution and an initial timeout of Ms.

If Ms is negative the timer is not initialized with the current time.

Definition at line 762 of file tools.c.

References begin, end, and Set().

Member Function Documentation

◆ Elapsed()

uint64_t cTimeMs::Elapsed ( void ) const

Returns the number of milliseconds that have elapsed since the last call to Set().

Definition at line 825 of file tools.c.

References begin, and Now().

Referenced by cKbdRemote::Action(), cLircUsrRemote::Action(), cRcuRemote::Action(), cRecorder::Action(), cThread::Start(), and WriteAllOrNothing().

◆ Now()

uint64_t cTimeMs::Now ( void )
static

Definition at line 769 of file tools.c.

References dsyslog, and esyslog.

Referenced by cTrueColorDemo::Action(), Elapsed(), Remaining(), Set(), and TimedOut().

◆ Remaining()

uint64_t cTimeMs::Remaining ( void ) const

Returns the number of milliseconds remaining until the timer times out.

A negative value means that the timer has timed out that many milliseconds in the past.

Definition at line 830 of file tools.c.

References end, and Now().

◆ Reset()

void cTimeMs::Reset ( void )

Resets the timer to the same timeout as given in the last call to Set().

This is equivalent to calling Set() with a value, but saves you from having to specify the value again.

Definition at line 835 of file tools.c.

References begin, end, and Set().

Referenced by cRecorder::Action().

◆ Set()

void cTimeMs::Set ( int Ms = 0)

Sets the timer.

Call Elapsed() to get the number of milliseconds since the timer has been set. If Ms is greater than 0, TimedOut() returns true as soon as Ms milliseconds have passed since calling Set(). If Ms is negative, results are undefined.

Definition at line 812 of file tools.c.

References begin, end, and Now().

Referenced by cDvbTuner::Action(), cKbdRemote::Action(), cLircUsrRemote::Action(), cRcuRemote::Action(), cTimeMs(), cSVDRPClient::Process(), and Reset().

◆ TimedOut()

bool cTimeMs::TimedOut ( void ) const

Returns true if the number of milliseconds given in the last call to Set() have passed.

Definition at line 820 of file tools.c.

References end, and Now().

Referenced by cDvbTuner::Action(), cRecorder::Action(), cThread::Cancel(), cCamSlot::CanDecrypt(), cSVDRPClient::Process(), and cSVDRPServerHandler::WaitUntilReady().

Member Data Documentation

◆ begin

uint64_t cTimeMs::begin
private

Definition at line 408 of file tools.h.

Referenced by cTimeMs(), Elapsed(), Reset(), and Set().

◆ end

uint64_t cTimeMs::end
private

Definition at line 409 of file tools.h.

Referenced by cTimeMs(), Remaining(), Reset(), Set(), and TimedOut().


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