#include <icy/datetime.h>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.
| 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()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.
const
Timestamp::TimeDiff elapsed() constReturns the elapsed time in microseconds since the stopwatch started.
const
int elapsedSeconds() constReturns the number of seconds elapsed since the stopwatch started.
const
int elapsedMilliseconds() constReturns the number of milliseconds elapsed since the stopwatch started.
| Return | Name | Description |
|---|---|---|
Timestamp::TimeVal | resolution static | Returns the resolution of the stopwatch. |
static
static Timestamp::TimeVal resolution()Returns the resolution of the stopwatch.
Timestamp _startTimestamp::TimeDiff _elapsedbool _running| Return | Name | Description |
|---|---|---|
Stopwatch | Deleted constructor. |
Stopwatch(const Stopwatch &) = deleteDeleted constructor.