Scippy

SoPlex

Sequential object-oriented simPlex

WallclockTimer Class Reference

#include <wallclocktimer.h>

Public Member Functions

Construction / destruction
 WallclockTimer ()
 default constructor More...
 
 WallclockTimer (const WallclockTimer &old)
 copy constructor More...
 
WallclockTimeroperator= (const WallclockTimer &old)
 assignment operator More...
 
virtual ~WallclockTimer ()
 
Control
virtual void reset ()
 initialize timer, set timing accounts to zero. More...
 
virtual void start ()
 start timer, resume accounting user, system and real time. More...
 
virtual Real stop ()
 stop timer, return accounted user time. More...
 
virtual TYPE type ()
 return type of timer More...
 
Access
virtual Real time () const
 
virtual Real lastTime () const
 
- Public Member Functions inherited from Timer
 Timer ()
 default constructor More...
 
 Timer (const Timer &old)
 copy constructor More...
 
Timeroperator= (const Timer &old)
 assignment operator More...
 
virtual ~Timer ()
 
void getLastTimes (Real *userTime, Real *systemTime, Real *realTime) const
 return accounted time. get accounted user, system, or real time when ticks were updated last More...
 
Real realTimeLast () const
 return accounted real time without rechecking the clock More...
 

Private Member Functions

Internal helpers
Real wall2sec (time_t s, time_t us) const
 convert wallclock time to secounds. More...
 

Private Attributes

Data
time_t sec
 seconds More...
 
time_t usec
 microseconds More...
 
Real lasttime
 

Additional Inherited Members

- Public Types inherited from Timer
enum  TYPE { OFF = 0, USER_TIME = 1, WALLCLOCK_TIME = 2 }
 types of timers More...
 
- Protected Types inherited from Timer
enum  { RESET, STOPPED, RUNNING }
 status of the timer More...
 
- Protected Attributes inherited from Timer
enum soplex::Timer::{ RESET, STOPPED, RUNNINGstatus
 status of the timer More...
 

Detailed Description

Definition at line 38 of file wallclocktimer.h.

Constructor & Destructor Documentation

◆ WallclockTimer() [1/2]

default constructor

Definition at line 68 of file wallclocktimer.h.

◆ WallclockTimer() [2/2]

WallclockTimer ( const WallclockTimer old)

copy constructor

Definition at line 72 of file wallclocktimer.h.

◆ ~WallclockTimer()

virtual ~WallclockTimer ( )
virtual

Definition at line 84 of file wallclocktimer.h.

Member Function Documentation

◆ lastTime()

Real lastTime ( ) const
virtual

Implements Timer.

Definition at line 138 of file wallclocktimer.cpp.

References WallclockTimer::lasttime.

Referenced by WallclockTimer::type().

◆ operator=()

WallclockTimer& operator= ( const WallclockTimer old)

assignment operator

Definition at line 76 of file wallclocktimer.h.

References WallclockTimer::lasttime, WallclockTimer::sec, and WallclockTimer::usec.

◆ reset()

virtual void reset ( )
virtual

initialize timer, set timing accounts to zero.

Implements Timer.

Definition at line 92 of file wallclocktimer.h.

References Timer::RESET, WallclockTimer::start(), Timer::status, and WallclockTimer::stop().

◆ start()

void start ( )
virtual

start timer, resume accounting user, system and real time.

Implements Timer.

Definition at line 42 of file wallclocktimer.cpp.

References WallclockTimer::lasttime, Timer::RUNNING, WallclockTimer::sec, Timer::status, WallclockTimer::time(), and WallclockTimer::usec.

Referenced by WallclockTimer::reset().

◆ stop()

Real stop ( )
virtual

◆ time()

◆ type()

virtual TYPE type ( )
virtual

return type of timer

Implements Timer.

Definition at line 106 of file wallclocktimer.h.

References WallclockTimer::lastTime(), WallclockTimer::time(), and Timer::WALLCLOCK_TIME.

◆ wall2sec()

Real wall2sec ( time_t  s,
time_t  us 
) const
private

convert wallclock time to secounds.

Definition at line 55 of file wallclocktimer.h.

Referenced by WallclockTimer::stop(), and WallclockTimer::time().

Member Data Documentation

◆ lasttime

◆ sec

time_t sec
mutableprivate

◆ usec

time_t usec
mutableprivate