wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/Time/CTimer

CTimer

CTimer is a C++ class for timer functions.

Constructors

CTimer(void);

CTimer(int nValue, bool bMilliseconds = false);

Parameters

  • nValue - Time value, if bMilliseconds is false value is seconds, otherwise value is milliseconds
  • bMilliseconds - True to interpret nValue as milliseconds, false nValue is interpreted as seconds.

Example

CTimer tmr(10);

tmr.Start(); // Start 10 second count

while(1)
{
    // ... We can do some processing here
    if(tmr.GetExpired())
    {
        // 10 seconds is up
        break;
    }
}
CTimer tmr;

tmr.Set(10);

tmr.Start(); // Start 10 second count

while(1)
{
    // ... We can do some processing here
    if(tmr.GetExpired())
    {
        // 10 seconds is up
        break;
    }
}

Member Functions

Set

void Set(int nValue, bool bMilliseconds = false);

Parameters

  • nValue - Time value, if bMilliseconds is false value is seconds, otherwise value is milliseconds
  • bMilliseconds - True to interpret nValue as milliseconds, false nValue is interpreted as seconds.

Return Value

Function does not return a value.

Remarks

Example

Clear

void Clear(void);

Parameters

Function does not accept any parameters.

Return Value

Function does not return a value.

Remarks

Example

Last modified 14 years ago Last modified on 08/26/10 16:43:08
Note: See TracWiki for help on using the wiki.