#include <vlclock.h>
Public Member Functions | |
| vlClock (bool start=false) | |
| Default constructor. | |
| ~vlClock () | |
| Default destructor. | |
| void | start () |
| Start the clock. | |
| double | stop () |
| Stop the clock. | |
| void | restart () |
| Restarts the clock. Starts counting from zero again. | |
| double | get () const |
| Get total time for which the clock was active ( time between starts and stops ). | |
| double | getStepTime () const |
| Get time since the most recent call to start() in seconds. | |
Private Attributes | |
| timeval | m_stepStartTime |
| stores time when the timer was started (start() was called) | |
| timeval | m_endTime |
| stores time when the timer step was stopped | |
| timezone | m_timezone |
| Needed for call to gettimeofday. | |
| double | m_value |
| Time in milliseconds. | |
| double | m_stepValue |
| Time in milliseconds. | |
| bool | m_running |
| Clock is on or off. | |
Friends | |
| ostream & | operator<< (ostream &os, vlClock const &clock) |
| overriding << to enable writing time to a stream | |
Definition at line 43 of file vlclock.h.
|
|
Definition at line 34 of file vlclock.cpp. References m_stepStartTime, m_timezone, and start(). |
|
|
Definition at line 47 of file vlclock.cpp. |
|
|
NOTE :- This function does not stop the clock if its running. Definition at line 92 of file vlclock.cpp. References m_running, m_stepStartTime, and m_value. |
|
|
If the clock is not running, then it'll give the time for which the clock was running in the latest call to start and stop. NOTE :- This function does not stop the clock if its running. Definition at line 111 of file vlclock.cpp. References m_running, m_stepStartTime, and m_stepValue. Referenced by main(). |
|
|
Definition at line 80 of file vlclock.cpp. References m_running, m_stepStartTime, m_stepValue, m_timezone, and m_value. |
|
|
If the clock is already running, step clock will be re-started. Definition at line 57 of file vlclock.cpp. References m_running, m_stepStartTime, and m_timezone. |
|
|
Definition at line 68 of file vlclock.cpp. References m_endTime, m_running, m_stepStartTime, m_stepValue, m_timezone, and m_value. |
|
||||||||||||
|
|
|
|
Definition at line 76 of file vlclock.h. Referenced by stop(). |
|
|
Definition at line 85 of file vlclock.h. Referenced by get(), getStepTime(), restart(), start(), and stop(). |
|
|
Definition at line 73 of file vlclock.h. Referenced by get(), getStepTime(), restart(), start(), stop(), and vlClock(). |
|
|
Definition at line 82 of file vlclock.h. Referenced by getStepTime(), restart(), and stop(). |
|
|
|
|
|
|
1.3.3