Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CTimer Class Reference

CTimer. More...

#include <Timer.h>

Inheritance diagram for CTimer:

CCountdownTimer List of all members.

Public Member Functions

 CTimer ()
 CTimer.
virtual ~CTimer ()
 ~CTimer
int32 Start ()
 Start.
int32 Stop ()
 Stop.
int32 Reset ()
 Reset.
uint64 GetElapsedTime (bool thenReset=false)
 GetElapsedTime.

Static Public Member Functions

static TIMESTRUCT GetTime ()
 GetTime.

Static Public Attributes

static const TIMESTRUCT NullTime = {0}
 VERSION CONTROL HISTORY.

Detailed Description

CTimer.

Description: Basic timer class.

Limitations: This class is not thread safe!


Constructor & Destructor Documentation

CTimer::CTimer  ) 
 

CTimer.

Description: Initializes the timer's interal attributes.

Returns:
None
Limitations: None

CTimer::~CTimer  )  [virtual]
 

~CTimer

Description:

Returns:
None
Limitations: None


Member Function Documentation

uint64 CTimer::GetElapsedTime bool  thenReset = false  ) 
 

GetElapsedTime.

Description: Gets the elapsed time for this timer.

Parameters:
thenReset - Indicates whether the timer should be reset.
Returns:
uint64 The number of milliseconds elapsed from start to finish. -1 is returned if this function has been called before the Stop function is called.
Limitations: None

TIMESTRUCT CTimer::GetTime  )  [static]
 

GetTime.

Description: Returns the current time

Returns:
int64
Limitations: None

int32 CTimer::Reset  ) 
 

Reset.

Description: Resets the timer. The timer, if running, is stopped, and the elapsed time is reset to zero.

Returns:
int32 Will return 0 on success, non-zero otherwise.
Limitations:

Reimplemented in CCountdownTimer.

int32 CTimer::Start  ) 
 

Start.

Description: Starts timing.

Returns:
int32 Will return 0 on success, non-zero otherwise.
Limitations: None

int32 CTimer::Stop  ) 
 

Stop.

Description: Stops the timer.

Parameters:
 
Returns:
int32 Will return 0 on success, non-zero otherwise.
Limitations:


Member Data Documentation

const TIMESTRUCT CTimer::NullTime = {0} [static]
 

VERSION CONTROL HISTORY.

Revision
1.1

Log
Timer.cpp,v
Revision 1.1 2005/06/12 18:20:32 mabruns Initial Import

Revision 1.9 2005/05/13 01:29:44 bjsk3b Fixed Stop function

Revision 1.8 2005/05/09 02:44:21 tcsvw5 Added virtual destructor

Revision 1.7 2005/04/25 20:39:15 kjm266 Added function to determine if the timer is running.

Revision 1.6 2005/03/19 00:39:31 plh844 Fixed linux compile bugs.

Revision 1.5 2005/03/18 23:54:06 kjm266 Corrected error where calculation was overflowing the variable.

Revision 1.4 2005/03/16 05:15:47 kjm266 Corrected mistakes missed before last version was checked in.

Revision 1.3 2005/03/16 04:49:00 kjm266 Modified the timer. It is now a stopwatch. Calling GetElapsedTime while the timer is running will return the elapsed time from the begining till the time of the function call.

Revision 1.2 2005/03/07 00:40:26 plh844 Made all unsigned variables signed.

Revision 1.1 2005/03/06 23:53:28 plh844 Fixed a usage bug in obtaining the current time.

Revision 1.0 2005/03/03 22:26:26 plh844 Initial revision

Revision 1.4 2005/02/03 20:39:04 cafene Added CVS expansion keywords to the template.


The documentation for this class was generated from the following files:
Copyright (c) 2005 Matt Bruns, Pat Hammond, Kevin Markussen, Travis Service, Brain Shaver

SourceForge.net Logo