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
TExeTm Class Reference

#include <tm.h>

Public Member Functions

 TExeTm ()
 
 TExeTm (const TExeTm &Tm)
 
TExeTmoperator= (const TExeTm &Tm)
 
void Tick ()
 
int GetTime () const
 
double GetSecs () const
 
int GetSecInt ()
 
const char * GetStr () const
 
TStr GetStr2 () const
 
const char * GetTmStr () const
 

Static Public Member Functions

static char * GetCurTm ()
 

Private Attributes

int LastTick
 

Detailed Description

Definition at line 354 of file tm.h.

Constructor & Destructor Documentation

TExeTm::TExeTm ( )
inline

Definition at line 358 of file tm.h.

358 : LastTick(0) { Tick(); }
int LastTick
Definition: tm.h:356
void Tick()
Definition: tm.h:363
TExeTm::TExeTm ( const TExeTm Tm)
inline

Definition at line 359 of file tm.h.

359 : LastTick(Tm.LastTick) { }
int LastTick
Definition: tm.h:356

Member Function Documentation

static char* TExeTm::GetCurTm ( )
inlinestatic

Definition at line 373 of file tm.h.

373 { static TStr TmStr; TmStr=TSecTm::GetCurTm().GetTmStr(); return TmStr.CStr(); }
Definition: dt.h:412
static TSecTm GetCurTm()
Definition: tm.cpp:692
TStr GetTmStr() const
Definition: tm.cpp:515
char * CStr()
Definition: dt.h:476
int TExeTm::GetSecInt ( )
inline

Definition at line 366 of file tm.h.

366 { return TFlt::Round(GetSecs()); }
static int Round(const double &Flt)
Definition: dt.h:1337
double GetSecs() const
Definition: tm.h:365
double TExeTm::GetSecs ( ) const
inline

Definition at line 365 of file tm.h.

365 {return double(clock()-LastTick)/double(CLOCKS_PER_SEC);}
int LastTick
Definition: tm.h:356
const char* TExeTm::GetStr ( ) const
inline

Definition at line 367 of file tm.h.

367 {return GetTmStr();}
const char * GetTmStr() const
Definition: tm.h:369
TStr TExeTm::GetStr2 ( ) const
inline

Definition at line 368 of file tm.h.

368 {return GetTmStr();}
const char * GetTmStr() const
Definition: tm.h:369
int TExeTm::GetTime ( ) const
inline

Definition at line 364 of file tm.h.

364 {return int(clock()-LastTick);}
int LastTick
Definition: tm.h:356
const char* TExeTm::GetTmStr ( ) const
inline

Definition at line 369 of file tm.h.

369  { static char TmStr[32];
370  if (GetSecs() < 60) { sprintf(TmStr, "%.2fs", GetSecs()); }
371  else if (GetSecs() < 3600) { sprintf(TmStr, "%02dm%02ds", int(GetSecs())/60, int(GetSecs())%60); }
372  else { sprintf(TmStr, "%02dh%02dm", int(GetSecs())/3600, (int(GetSecs())%3600)/60); } return TmStr; }
double GetSecs() const
Definition: tm.h:365
TExeTm& TExeTm::operator= ( const TExeTm Tm)
inline

Definition at line 360 of file tm.h.

360  {
361  LastTick=Tm.LastTick; return *this;}
int LastTick
Definition: tm.h:356
void TExeTm::Tick ( )
inline

Definition at line 363 of file tm.h.

363 {LastTick=(int)clock();}
int LastTick
Definition: tm.h:356

Member Data Documentation

int TExeTm::LastTick
private

Definition at line 356 of file tm.h.


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