Hi,
I'm making some coundown timer (minutes:seconds) and i want this to be precise for a second...
Here's the code setup:
Code:
var milliseconds = 0;
var seconds = 10;
var minutes = 01;
....

PANEL* pan_time =
{
	pos_x = 740;
	pos_y = 5;
	digits(200, 70, "min: %0.f", system_font, 1, minutes);
	digits(100, 90, "sec: %0.0f", system_font, 1, seconds);
	digits(100, 110, "msecs: %0.f", system_font, 1, milliseconds);
	flags = SHOW;
}

....
function myTimer_startup()
{	   
	while (minutes >= 0)
	 {
	    milliseconds += (timer() / 1000);
	    if (milliseconds > 1000 && seconds > 0)
	    {
	      milliseconds -= 1000;	      
	      seconds -= 1;	      
	    }
	
	    if(seconds == 0 && minutes > 0)
	    {
	      minutes -= 1;
	      seconds = 10;	
	    }	   	    
	
	    wait (1);
	 }	
	
	milliseconds = 0;   
}



but i've found out that "milliseconds" value is still computing & wouldn't stop even it's already break out in the loop & reset its value to 0.. this would cause a crash if this variable "milliseconds" would excess on its data value it could contain.

So, i'm wondering if this timer() would always run in the backround... it's so strange.

Hope someone could help. Thanks