SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TTmStopWatch Class Reference

#include <tm.h>

Collaboration diagram for TTmStopWatch:

Public Member Functions

 TTmStopWatch (const bool &Start=false)
 
void Start ()
 
void Stop ()
 
void Reset (const bool &Start)
 
int GetTime () const
 
double GetSec () const
 
int GetSecInt () const
 
double GetMSec () const
 
int GetMSecInt () const
 

Private Attributes

int TmSoFar
 
bool RunningP
 
TExeTm ExeTm
 

Detailed Description

Definition at line 379 of file tm.h.

Constructor & Destructor Documentation

TTmStopWatch::TTmStopWatch ( const bool &  Start = false)
inline

Definition at line 385 of file tm.h.

385 : TmSoFar(0), RunningP(Start) { }
void Start()
Definition: tm.h:387
bool RunningP
Definition: tm.h:382
int TmSoFar
Definition: tm.h:381

Member Function Documentation

double TTmStopWatch::GetMSec ( ) const
inline

Definition at line 394 of file tm.h.

References GetTime().

Referenced by GetMSecInt().

394 { return double(GetTime()) / double(CLOCKS_PER_SEC/1000); }
int GetTime() const
Definition: tm.h:391

Here is the call graph for this function:

Here is the caller graph for this function:

int TTmStopWatch::GetMSecInt ( ) const
inline

Definition at line 395 of file tm.h.

References GetMSec(), and TFlt::Round().

Referenced by TTmTimer::IsTimeUp().

395 { return TFlt::Round(GetMSec()); }
double GetMSec() const
Definition: tm.h:394
static int Round(const double &Flt)
Definition: dt.h:1429

Here is the call graph for this function:

Here is the caller graph for this function:

double TTmStopWatch::GetSec ( ) const
inline

Definition at line 392 of file tm.h.

References GetTime().

Referenced by GetSecInt().

392 { return double(GetTime()) / double(CLOCKS_PER_SEC); }
int GetTime() const
Definition: tm.h:391

Here is the call graph for this function:

Here is the caller graph for this function:

int TTmStopWatch::GetSecInt ( ) const
inline

Definition at line 393 of file tm.h.

References GetSec(), and TFlt::Round().

393 { return TFlt::Round(GetSec()); }
static int Round(const double &Flt)
Definition: dt.h:1429
double GetSec() const
Definition: tm.h:392

Here is the call graph for this function:

int TTmStopWatch::GetTime ( ) const
inline

Definition at line 391 of file tm.h.

References ExeTm, TExeTm::GetTime(), RunningP, and TmSoFar.

Referenced by GetMSec(), and GetSec().

391 { return TmSoFar + (RunningP ? ExeTm.GetTime() : 0); }
TExeTm ExeTm
Definition: tm.h:383
int GetTime() const
Definition: tm.h:365
bool RunningP
Definition: tm.h:382
int TmSoFar
Definition: tm.h:381

Here is the call graph for this function:

Here is the caller graph for this function:

void TTmStopWatch::Reset ( const bool &  Start)
inline

Definition at line 389 of file tm.h.

References ExeTm, RunningP, Start(), TExeTm::Tick(), and TmSoFar.

Referenced by TTmTimer::Restart().

389 { TmSoFar = 0; RunningP = Start; ExeTm.Tick(); }
void Start()
Definition: tm.h:387
TExeTm ExeTm
Definition: tm.h:383
bool RunningP
Definition: tm.h:382
void Tick()
Definition: tm.h:364
int TmSoFar
Definition: tm.h:381

Here is the call graph for this function:

Here is the caller graph for this function:

void TTmStopWatch::Start ( )
inline

Definition at line 387 of file tm.h.

References ExeTm, RunningP, and TExeTm::Tick().

Referenced by Reset().

387 { if (!RunningP) { RunningP = true; ExeTm.Tick(); } }
TExeTm ExeTm
Definition: tm.h:383
bool RunningP
Definition: tm.h:382
void Tick()
Definition: tm.h:364

Here is the call graph for this function:

Here is the caller graph for this function:

void TTmStopWatch::Stop ( )
inline

Definition at line 388 of file tm.h.

References ExeTm, TExeTm::GetTime(), RunningP, and TmSoFar.

388 { if (RunningP) { RunningP = false; TmSoFar += ExeTm.GetTime(); } }
TExeTm ExeTm
Definition: tm.h:383
int GetTime() const
Definition: tm.h:365
bool RunningP
Definition: tm.h:382
int TmSoFar
Definition: tm.h:381

Here is the call graph for this function:

Member Data Documentation

TExeTm TTmStopWatch::ExeTm
private

Definition at line 383 of file tm.h.

Referenced by GetTime(), Reset(), Start(), and Stop().

bool TTmStopWatch::RunningP
private

Definition at line 382 of file tm.h.

Referenced by GetTime(), Reset(), Start(), and Stop().

int TTmStopWatch::TmSoFar
private

Definition at line 381 of file tm.h.

Referenced by GetTime(), Reset(), and Stop().


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