API Guides > ConceptRT 3.x
DownTimer Class Reference

Time down counter until TimeZero is reached More...

Detailed Description

Time down counter until TimeZero is reached

Public Member Methods

 DownTimer (TimeSpan duration=TimeZero)
 Constructor. More...
 
void SetTime (TimeSpan duration)
 Sets the timer duration. More...
 
void Clear ()
 Set the time to TimeZero More...
 
TimeSpan GetTime () const
 Gets the remaining time. More...
 
bool GetElapsed () const
 Query if the counter has elapsed. More...
 

Constructor & Destructor Documentation

DownTimer ( TimeSpan  duration = TimeZero)

Constructor.

Parameters
duration(optional) timer duration.

Methods Documentation

void Clear ( )

Set the time to TimeZero

bool GetElapsed ( ) const

Query if the counter has elapsed.

Returns
true if it's elpased, false if not.
TimeSpan GetTime ( ) const

Gets the remaining time.

Returns
The remaining time.
void SetTime ( TimeSpan  duration)

Sets the timer duration.

Parameters
durationThe duration.

Duration can be negative. In this case GetElapsed will answer directly true.