Stopwatch
Stopwatch
#include <icy/datetime.h>class StopwatchDefined in src/base/include/icy/datetime.h:1733
A simple facility to measure time intervals with microsecond resolution.
The Stopwatch uses the current system time, so if the system time changes the measured time will be incorrect.
List of all members
| Name | Kind | Owner |
|---|---|---|
Stopwatch | function | Declared here |
~Stopwatch | function | Declared here |
start | function | Declared here |
stop | function | Declared here |
reset | function | Declared here |
restart | function | Declared here |
elapsed | function | Declared here |
elapsedSeconds | function | Declared here |
elapsedMilliseconds | function | Declared here |
resolution | function | Declared here |
_start | variable | Declared here |
_elapsed | variable | Declared here |
_running | variable | Declared here |
Stopwatch | function | Declared here |
operator= | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
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
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
_start
Timestamp _startDefined in src/base/include/icy/datetime.h:1770
_elapsed
Timestamp::TimeDiff _elapsedDefined in src/base/include/icy/datetime.h:1771
_running
bool _runningDefined in src/base/include/icy/datetime.h:1772
Private Methods
| Return | Name | Description |
|---|---|---|
Stopwatch | Deleted constructor. |
Stopwatch
Stopwatch(const Stopwatch &) = deleteDefined in src/base/include/icy/datetime.h:1767
Deleted constructor.
