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

Version 2 (modified by Don Wilson, 14 years ago) ( diff )

--

CTimer

CTimer is a C++ class for timer functions.

Constructor

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;
    }
}

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

Note: See TracWiki for help on using the wiki.