#include <stopwatch.h>
Public Methods | |
StopWatch () | |
Construct a stop watch. More... | |
void | start () |
Start the timer. More... | |
void | stop () |
Stop the timer. More... | |
void | reset () |
Reset all times to zero. More... | |
bool | isRunning () const |
Find out if the stop watch is currently running. More... | |
unsigned32 | milliseconds () const |
Get the current time in milli-seconds. More... | |
unsigned32 | seconds () const |
Get the current time in seconds. More... |
You can start and stop a stopwatch.
|
Construct a stop watch.
|
|
Find out if the stop watch is currently running. Checks if the stop watch is currently running.
|
|
Get the current time in milli-seconds. If the stop watch is currently running, this will return the number of milli-seconds that have elapsed since the stop watch was started, till the current time. If the stop watch is stopped, this returns the number of milli-seconds from the time the stop watch was started, to the time the stop watch was stopped. If the timer has never started, the time returned will be zero.
|
|
Reset all times to zero. Sets the stopwatch to its initial state of zero, and not running. |
|
Get the current time in seconds. If the stop watch is currently running, this will return the number of seconds that have elapsed since the stop watch was started, till the current time. If the stop watch is stopped, this returns the number of seconds from the time the stop watch was started, to the time the stopwatch was stopped. The number of milliseconds is ignored. So if the elapsed time is 1500 milliseconds, seconds() returns 1 second. If the timer has never started, the time returned will be zero.
|
|
Start the timer. Starts the stopwatch timer. Clears any stored laps. |
|
Stop the timer. Stops the stop watch timer. Notes the time the timer was stopped. |