Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ssobjects::StopWatch Class Reference

Timer operations. More...

#include <stopwatch.h>

List of all members.

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...


Detailed Description

Timer operations.

You can start and stop a stopwatch.

Note:
Plans are that this should work seemlessly with simple time or something so I can produce a report on how many days, minutes and seconds a timer has run.


Constructor & Destructor Documentation

ssobjects::StopWatch::StopWatch ( )
 

Construct a stop watch.


Member Function Documentation

bool ssobjects::StopWatch::isRunning ( ) const
 

Find out if the stop watch is currently running.

Checks if the stop watch is currently running.

Returns:
true if the stop watch is currently active, false otherwise.

unsigned32 ssobjects::StopWatch::milliseconds ( ) const
 

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.

Returns:
The number of milli-seconds the stop watch has counted.

void ssobjects::StopWatch::reset ( )
 

Reset all times to zero.

Sets the stopwatch to its initial state of zero, and not running.

unsigned32 ssobjects::StopWatch::seconds ( ) const
 

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.

Returns:
The number of seconds the stop watch has counted.

void ssobjects::StopWatch::start ( )
 

Start the timer.

Starts the stopwatch timer. Clears any stored laps.

void ssobjects::StopWatch::stop ( )
 

Stop the timer.

Stops the stop watch timer. Notes the time the timer was stopped.


The documentation for this class was generated from the following files:
Generated at Tue Sep 25 00:26:37 2001 for SimpleServerObjects by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001