The time is specified in units of 20 milliseconds.
Syntax
unsigned int TimerValue(void);
Parameters
None
Return value
Remaining timer value in units of 20 milliseconds.For example, if TimerValue returns 5, 100 milliseconds will elapse before the timer is finished.
Remarks
The timer can be started with the StartTimer function.The return value range is 0-4,294,967,295.
Requirements
Header file:
lib.hLibrary file:
libSTARTUPOPH5000.a
Sample
#include <stdio.h>
#include "lib.h"
void main(void)
{
for (;;)
{
printf("\fTick off 5 sec");
StartTimer(TIME_100MS * 50);
while(!EndTimer())
{
printf("\nTime left %d s", TimerValue() / 50);
Sound(TSTANDARD, VSTANDARD, SMEDIUM,0);
Delay(TIME_100MS*10);
}
printf("\nDone");
ResetKey();
while(!kbhit())
{
Idle();
}
}
}
Last updated: 2020/10/08