#include <usertimer.h>
Public Member Functions | |
Construction / destruction | |
| UserTimer () | |
| default constructor More... | |
| UserTimer (const UserTimer &old) | |
| copy constructor More... | |
| UserTimer & | operator= (const UserTimer &old) |
| assignment operator More... | |
| virtual | ~UserTimer () |
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... | |
| Timer & | operator= (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 | ticks2sec (clock_t ticks) const |
| convert ticks to secounds. More... | |
| void | updateTicks () const |
| get actual user ticks from the system. More... | |
Private Attributes | |
Data | |
| clock_t | uAccount |
| user time More... | |
| clock_t | uTicks |
| user ticks More... | |
| Real | lasttime |
Static Private Attributes | |
number of ticks per second | |
| static const long | ticks_per_sec = long(TIMES_TICKS_PER_SEC) |
| ticks per secound, should be constant More... | |
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, RUNNING } | status |
| status of the timer More... | |
Definition at line 29 of file usertimer.h.
| UserTimer | ( | ) |
default constructor
Definition at line 68 of file usertimer.h.
copy constructor
Definition at line 74 of file usertimer.h.
|
virtual |
Definition at line 89 of file usertimer.h.
|
virtual |
Implements Timer.
Definition at line 117 of file usertimer.cpp.
References UserTimer::lasttime.
Referenced by UserTimer::type().
assignment operator
Definition at line 80 of file usertimer.h.
References UserTimer::lasttime, UserTimer::uAccount, and UserTimer::uTicks.
|
virtual |
initialize timer, set timing accounts to zero.
Implements Timer.
Definition at line 97 of file usertimer.h.
References Timer::RESET, UserTimer::start(), Timer::status, and UserTimer::stop().
|
virtual |
start timer, resume accounting user, system and real time.
Implements Timer.
Definition at line 72 of file usertimer.cpp.
References UserTimer::lasttime, Timer::RUNNING, Timer::status, UserTimer::uAccount, UserTimer::updateTicks(), and UserTimer::uTicks.
Referenced by UserTimer::reset().
|
virtual |
stop timer, return accounted user time.
Implements Timer.
Definition at line 87 of file usertimer.cpp.
References Timer::RUNNING, Timer::status, Timer::STOPPED, UserTimer::ticks2sec(), UserTimer::uAccount, UserTimer::updateTicks(), and UserTimer::uTicks.
Referenced by UserTimer::reset().
|
private |
convert ticks to secounds.
Definition at line 52 of file usertimer.h.
References UserTimer::updateTicks().
Referenced by UserTimer::stop(), and UserTimer::time().
|
virtual |
Implements Timer.
Definition at line 102 of file usertimer.cpp.
References UserTimer::lasttime, Timer::RUNNING, Timer::status, UserTimer::ticks2sec(), UserTimer::uAccount, UserTimer::updateTicks(), and UserTimer::uTicks.
Referenced by UserTimer::type().
|
virtual |
return type of timer
Implements Timer.
Definition at line 111 of file usertimer.h.
References UserTimer::lastTime(), UserTimer::time(), and Timer::USER_TIME.
|
private |
get actual user ticks from the system.
Definition at line 52 of file usertimer.cpp.
References UserTimer::uTicks.
Referenced by UserTimer::start(), UserTimer::stop(), UserTimer::ticks2sec(), and UserTimer::time().
|
mutableprivate |
Definition at line 45 of file usertimer.h.
Referenced by UserTimer::lastTime(), UserTimer::operator=(), UserTimer::start(), and UserTimer::time().
|
staticprivate |
ticks per secound, should be constant
Definition at line 36 of file usertimer.h.
|
mutableprivate |
user time
Definition at line 42 of file usertimer.h.
Referenced by UserTimer::operator=(), UserTimer::start(), UserTimer::stop(), and UserTimer::time().
|
mutableprivate |
user ticks
Definition at line 43 of file usertimer.h.
Referenced by UserTimer::operator=(), UserTimer::start(), UserTimer::stop(), UserTimer::time(), and UserTimer::updateTicks().