#include <Timer.h>
Public Member Functions | |
Timer (void) | |
unsigned long | Get (void) |
void | Reset (void) |
void | Start (void) |
void | Stop (void) |
Timer::Timer | ( | void | ) |
Create a new timer object. Create a new timer object and reset the time to zero. The timer is initially not running and must be started.
unsigned long Timer::Get | ( | void | ) |
Get the current time from the timer. If the clock is running it is derived from the current system clock the start time stored in the timer class. If the clock is not running, then return the time when it was last stopped. //unsigned Current time value for this timer in milliseconds
void Timer::Reset | ( | void | ) |
Reset the timer by setting the time to 0. Make the timer startTime the current time so new requests will be relative now
void Timer::Start | ( | void | ) |
Start the timer running. Just set the running flag to true indicating that all time requests should be relative to the system clock.
void Timer::Stop | ( | void | ) |
Stop the timer. This computes the time as of now and clears the running flag, causing all subsequent time requests to be read from the accumulated time rather than looking at the system clock.