|
The Pedigree Project 0.1
|
#include <Stopwatch.h>
Collaboration diagram for Time::Stopwatch:Public Member Functions | |
| Stopwatch (bool startRunning=false) | |
| void | start () |
| Start the stopwatch if it is not already started. | |
| void | stop () |
| Stop the stopwatch if it is not already stopped. | |
| void | reset () |
| Reset the stopwatch to zero. | |
| Timestamp | value () |
| Read the stopwatch value in nanoseconds. | |
Private Attributes | |
| Timestamp | m_Value |
| Current value. | |
| Timestamp | m_StartValue |
| Start time. | |
| bool | m_bRunning |
| Running or not. | |
Stopwatch provides a timer that can be stopped, started, and reset.
The value only ticks while the timer is running (it does not tick up during stop). The value is only current while the stopwatch is stopped.
Definition at line 32 of file Stopwatch.h.
| Time::Stopwatch::Stopwatch | ( | bool | startRunning = false | ) |
Definition at line 25 of file Stopwatch.cc.
|
virtual |
Definition at line 33 of file Stopwatch.cc.
| void Time::Stopwatch::reset | ( | ) |
Reset the stopwatch to zero.
Definition at line 47 of file Stopwatch.cc.
| void Time::Stopwatch::start | ( | ) |
Start the stopwatch if it is not already started.
Definition at line 35 of file Stopwatch.cc.
| void Time::Stopwatch::stop | ( | ) |
Stop the stopwatch if it is not already stopped.
Definition at line 40 of file Stopwatch.cc.
| Timestamp Time::Stopwatch::value | ( | ) |
Read the stopwatch value in nanoseconds.
Definition at line 53 of file Stopwatch.cc.
|
private |
Running or not.
Definition at line 57 of file Stopwatch.h.
|
private |
Start time.
Definition at line 54 of file Stopwatch.h.
|
private |
Current value.
Definition at line 51 of file Stopwatch.h.