C Language Development Kit/Functions/EndTimer

From OptiWiki

Jump to: navigation, search
Description This function checks if the time specified with the starttimer() function has elapsed.
Syntax
int endtimer(void);
Arguments None
Returns
0 The specified time has not yet elapsed.
1 The specified time has elapsed.
Remarks None
Example
#include "lib.h"
#include <stdio.h>
 
void main( void )
{
    while( 1 )
    {
        printf("\fTick off 5 sec");
        starttimer( 255 );
        while( !endtimer())
        {
            printf("\nTime left %d s", timervalue()/50);
            sound( TSTANDARD, VSTANDARD, SMEDIUM, 0);
            delay( 50 );
        }
 
        printf("\nDone");
        resetkey();
        while( !kbhit())
            idle();
    }
}


Views
Personal tools