Cheetah Software  1.0
Timer Class Reference

#include <Timer.h>

+ Collaboration diagram for Timer:

Public Member Functions

 Timer ()
 
void start ()
 
double getMs ()
 
int64_t getNs ()
 
double getSeconds ()
 

Public Attributes

struct timespec _startTime
 

Detailed Description

Definition at line 12 of file Timer.h.

Constructor & Destructor Documentation

Timer::Timer ( )
inlineexplicit

Definition at line 14 of file Timer.h.

References start().

14 { start(); }
void start()
Definition: Timer.h:16

+ Here is the call graph for this function:

Member Function Documentation

double Timer::getMs ( )
inline

Definition at line 18 of file Timer.h.

References getNs().

18 { return (double)getNs() / 1.e6; }
int64_t getNs()
Definition: Timer.h:20

+ Here is the call graph for this function:

int64_t Timer::getNs ( )
inline

Definition at line 20 of file Timer.h.

References _startTime.

20  {
21  struct timespec now;
22  clock_gettime(CLOCK_MONOTONIC, &now);
23  return (int64_t)(now.tv_nsec - _startTime.tv_nsec) +
24  1000000000 * (now.tv_sec - _startTime.tv_sec);
25  }
struct timespec _startTime
Definition: Timer.h:29

+ Here is the caller graph for this function:

double Timer::getSeconds ( )
inline

Definition at line 27 of file Timer.h.

References getNs().

27 { return (double)getNs() / 1.e9; }
int64_t getNs()
Definition: Timer.h:20

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Timer::start ( )
inline

Definition at line 16 of file Timer.h.

References _startTime.

16 { clock_gettime(CLOCK_MONOTONIC, &_startTime); }
struct timespec _startTime
Definition: Timer.h:29

+ Here is the caller graph for this function:

Member Data Documentation

struct timespec Timer::_startTime

Definition at line 29 of file Timer.h.


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