Stopwatch
#include <icy/datetime.h>
class StopwatchDefined in src/base/include/icy/datetime.h:1733
The Stopwatch uses the current system time, so if the system time changes the measured time will be incorrect.
Public Methods
| Return | Name | Description |
|---|---|---|
Stopwatch | ||
~Stopwatch | ||
void | start | Starts (or restarts) the stopwatch. |
void | stop | Stops or pauses the stopwatch. |
void | reset | Resets the stopwatch. |
void | restart | Resets and starts the stopwatch. |
Timestamp::TimeDiff | elapsed const | Returns the elapsed time in microseconds since the stopwatch started. |
int | elapsedSeconds const | Returns the number of seconds elapsed since the stopwatch started. |
int | elapsedMilliseconds const | Returns the number of milliseconds elapsed since the stopwatch started. |
Stopwatch
Stopwatch()Defined in src/base/include/icy/datetime.h:1736
~Stopwatch
~Stopwatch()Defined in src/base/include/icy/datetime.h:1737
start
void start()Defined in src/base/include/icy/datetime.h:1740
Starts (or restarts) the stopwatch.
stop
void stop()Defined in src/base/include/icy/datetime.h:1743
Stops or pauses the stopwatch.
reset
void reset()Defined in src/base/include/icy/datetime.h:1746
Resets the stopwatch.
restart
void restart()Defined in src/base/include/icy/datetime.h:1749
Resets and starts the stopwatch.
elapsed
const
Timestamp::TimeDiff elapsed() constDefined in src/base/include/icy/datetime.h:1753
Returns the elapsed time in microseconds since the stopwatch started.
elapsedSeconds
const
int elapsedSeconds() constDefined in src/base/include/icy/datetime.h:1757
Returns the number of seconds elapsed since the stopwatch started.
elapsedMilliseconds
const
int elapsedMilliseconds() constDefined in src/base/include/icy/datetime.h:1761
Returns the number of milliseconds elapsed since the stopwatch started.
Public Static Methods
| Return | Name | Description |
|---|---|---|
Timestamp::TimeVal | resolution static | Returns the resolution of the stopwatch. |
resolution
static
static Timestamp::TimeVal resolution()Defined in src/base/include/icy/datetime.h:1764
Returns the resolution of the stopwatch.
Private Attributes
| Return | Name | Description |
|---|---|---|
Timestamp | _start | |
Timestamp::TimeDiff | _elapsed | |
bool | _running |
_start
Timestamp _startType: Timestamp
Defined in src/base/include/icy/datetime.h:1770
_elapsed
Timestamp::TimeDiff _elapsedType: Timestamp::TimeDiff
Defined in src/base/include/icy/datetime.h:1771
_running
bool _runningDefined in src/base/include/icy/datetime.h:1772
Private Methods
Stopwatch
Stopwatch(const Stopwatch &) = deleteDefined in src/base/include/icy/datetime.h:1767
Deleted constructor.
operator=
Stopwatch & operator=(const Stopwatch &) = deleteDefined in src/base/include/icy/datetime.h:1768
Deleted assignment operator.
