SNAP Library 2.4, User Reference  2015-05-11 19:40:56
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>

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 378 of file tm.h.

Constructor & Destructor Documentation

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

Definition at line 384 of file tm.h.

384 : TmSoFar(0), RunningP(Start) { }
void Start()
Definition: tm.h:386
bool RunningP
Definition: tm.h:381
int TmSoFar
Definition: tm.h:380

Member Function Documentation

double TTmStopWatch::GetMSec ( ) const
inline

Definition at line 393 of file tm.h.

393 { return double(GetTime()) / double(CLOCKS_PER_SEC/1000); }
int GetTime() const
Definition: tm.h:390
int TTmStopWatch::GetMSecInt ( ) const
inline

Definition at line 394 of file tm.h.

394 { return TFlt::Round(GetMSec()); }
double GetMSec() const
Definition: tm.h:393
static int Round(const double &Flt)
Definition: dt.h:1337
double TTmStopWatch::GetSec ( ) const
inline

Definition at line 391 of file tm.h.

391 { return double(GetTime()) / double(CLOCKS_PER_SEC); }
int GetTime() const
Definition: tm.h:390
int TTmStopWatch::GetSecInt ( ) const
inline

Definition at line 392 of file tm.h.

392 { return TFlt::Round(GetSec()); }
static int Round(const double &Flt)
Definition: dt.h:1337
double GetSec() const
Definition: tm.h:391
int TTmStopWatch::GetTime ( ) const
inline

Definition at line 390 of file tm.h.

390 { return TmSoFar + (RunningP ? ExeTm.GetTime() : 0); }
TExeTm ExeTm
Definition: tm.h:382
int GetTime() const
Definition: tm.h:364
bool RunningP
Definition: tm.h:381
int TmSoFar
Definition: tm.h:380
void TTmStopWatch::Reset ( const bool &  Start)
inline

Definition at line 388 of file tm.h.

388 { TmSoFar = 0; RunningP = Start; ExeTm.Tick(); }
void Start()
Definition: tm.h:386
TExeTm ExeTm
Definition: tm.h:382
bool RunningP
Definition: tm.h:381
void Tick()
Definition: tm.h:363
int TmSoFar
Definition: tm.h:380
void TTmStopWatch::Start ( )
inline

Definition at line 386 of file tm.h.

386 { if (!RunningP) { RunningP = true; ExeTm.Tick(); } }
TExeTm ExeTm
Definition: tm.h:382
bool RunningP
Definition: tm.h:381
void Tick()
Definition: tm.h:363
void TTmStopWatch::Stop ( )
inline

Definition at line 387 of file tm.h.

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

Member Data Documentation

TExeTm TTmStopWatch::ExeTm
private

Definition at line 382 of file tm.h.

bool TTmStopWatch::RunningP
private

Definition at line 381 of file tm.h.

int TTmStopWatch::TmSoFar
private

Definition at line 380 of file tm.h.


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