SASC-NG
DVBSoftCAM

cTimeMs Class Reference

#include <tools.h>

List of all members.

Public Member Functions

 cTimeMs (int Ms=0)
 Creates a timer with ms resolution and an initial timeout of Ms.
void Set (int Ms=0)
bool TimedOut (void)
uint64_t Elapsed (void)

Static Public Member Functions

static uint64_t Now (void)

Detailed Description

Definition at line 239 of file tools.h.


Constructor & Destructor Documentation

cTimeMs::cTimeMs ( int  Ms = 0)

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

Definition at line 501 of file tools.cpp.

References Set().

{
  Set(Ms);
}

Member Function Documentation

uint64_t cTimeMs::Now ( void  ) [static]

Definition at line 506 of file tools.cpp.

References NULL.

Referenced by Elapsed(), Set(), and TimedOut().

{
  struct timeval t;
  if (gettimeofday(&t, NULL) == 0)
     return (uint64_t(t.tv_sec)) * 1000 + t.tv_usec / 1000;
  return 0;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines