SNAP Library, User Reference  2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TTmStopWatch Class Reference

#include <tm.h>

List of all members.

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.

: TmSoFar(0), RunningP(Start) { }

Member Function Documentation

double TTmStopWatch::GetMSec ( ) const [inline]

Definition at line 394 of file tm.h.

{ return double(GetTime()) / double(CLOCKS_PER_SEC/1000); }
int TTmStopWatch::GetMSecInt ( ) const [inline]

Definition at line 395 of file tm.h.

{ return TFlt::Round(GetMSec()); }
double TTmStopWatch::GetSec ( ) const [inline]

Definition at line 392 of file tm.h.

{ return double(GetTime()) / double(CLOCKS_PER_SEC); }
int TTmStopWatch::GetSecInt ( ) const [inline]

Definition at line 393 of file tm.h.

{ return TFlt::Round(GetSec()); }
int TTmStopWatch::GetTime ( ) const [inline]

Definition at line 391 of file tm.h.

{ return TmSoFar + (RunningP ? ExeTm.GetTime() : 0); }
void TTmStopWatch::Reset ( const bool &  Start) [inline]

Definition at line 389 of file tm.h.

{ TmSoFar = 0; RunningP = Start; ExeTm.Tick(); }
void TTmStopWatch::Start ( ) [inline]

Definition at line 387 of file tm.h.

{ if (!RunningP) { RunningP = true; ExeTm.Tick(); } }
void TTmStopWatch::Stop ( ) [inline]

Definition at line 388 of file tm.h.

{ if (RunningP) { RunningP = false; TmSoFar += ExeTm.GetTime(); } }

Member Data Documentation

Definition at line 383 of file tm.h.

bool TTmStopWatch::RunningP [private]

Definition at line 382 of file tm.h.

int TTmStopWatch::TmSoFar [private]

Definition at line 381 of file tm.h.


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