class StopWatch
A timer class suitable for absolute time-measurements.
If you rather want to wait for a certain time, use the Delay class. To measure the time delta between two events, use the Timer class.
Constructors
StopWatch () | Constructs a new StopWatch object. |
Methods
float ElapsedMilliseconds () | Returns the total elapsed time. |
Start () | Starts the StopWatch. |
int Started () | Returns true if the StopWatch is currently running, false if it is currently stopped. |
Stop () | Stops the StopWatch. |
Reference
method StopWatch () |
Constructs a new StopWatch object. |
method float ElapsedMilliseconds () |
Returns the total elapsed time. If the StopWatch was started, this returns the milliseconds currently elapsed since it was started. If it was stopped, returns the milliseconds that passed between Start() and Stop(). If it was not yet started, 0.0 is returned. It is possible to start and stop the StopWatch repeatedly to accumulate time spans. |
method Start () |
Starts the StopWatch. |
method int Started () |
Returns true if the StopWatch is currently running, false if it is currently stopped. |
method Stop () |
Stops the StopWatch. |