int origTicks;
} timerEvent;
+int Start_Timer_Secs(int seconds, timerCallback cb);
+int Start_Timer_MSecs(int msecs, timerCallback cb);
int Start_Timer(int ticks, timerCallback);
-int Get_Remaing_Timer_Ticks(int id);
+
+double Get_Remaining_Timer_Secs(int id);
+int Get_Remaining_Timer_MSecs(int id);
+int Get_Remaining_Timer_Ticks(int id);
int Cancel_Timer(int id);
}
+int Start_Timer_Secs(int seconds, timerCallback cb) {
+ return Start_Timer(seconds * HZ, cb);
+}
+
+
+int Start_Timer_MSecs(int msecs, timerCallback cb) {
+ msecs += 10 - (msecs % 10);
+
+ return Start_Timer(msecs * (HZ / 1000), cb);
+}
+
+
+
int Start_Timer(int ticks, timerCallback cb)
{
int ret;
}
}
-int Get_Remaing_Timer_Ticks(int id)
+
+int Get_Remaining_Timer_Ticks(int id)
{
int i;
return -1;
}
+
+
+double Get_Remaining_Timer_Secs(int id) {
+ return (Get_Remaining_Timer_Ticks(id) / HZ);
+}
+
+
+int Get_Remaining_Timer_MSecs(int id) {
+ return ((Get_Remaining_Timer_Ticks(id) * 1000) / HZ);
+}
+
+
+
int Cancel_Timer(int id)
{
int i;