HLIBpro  2.0
Public Member Functions | Friends | List of all members
TTimer Class Reference

Timer class. More...

#include <TTimer.hh>

Inheritance diagram for TTimer:
TCPUTimer TThreadCPUTimer TWallTimer

Public Member Functions

 TTimer (const timetype_t type=CPU_TIME)
 construct timer of type type
 
TTimerstart ()
 start timer, resets time-sum
 
TTimerpause ()
 pause timer, add elapsed time to sum
 
TTimercont ()
 continue timer, set start time to current time
 
double elapsed () const
 returns elapsed time without stopping timer
 
TTimerwall ()
 set type of time to wall clock time
 
TTimercpu ()
 set type of time to wall cpu time
 
TTimercpu_thread ()
 set type of time to wall cpu time
 
std::string to_string () const
 convert to string
 

Friends

std::ostream & operator<< (std::ostream &os, const TTimer &timer)
 stream output
 

Detailed Description

Provides class for timing either using wall time or cpu time, i.e. actual time doing something without waiting for free resources.