A STITCH IN TIME
------------------------
 
	Div has ten inbuilt variables for counting called timer[] these timers count/increment in milliseconds and start incrementing the millisecond your program starts running they can also be reset or set to any time. But the problem is my racing game, I don't want the lap times to be measured in milliseconds how can I change this?
	Now for some simple arithmetic 100 milliseconds is 1 second, therefore to change the timer value to seconds divide by 1 hundred. 60 seconds is 1 minute so to change from milliseconds to minutes divide by 100 then by 60. 60 minutes make up 1 hour so to change from milliseconds to hours divide by 100 then by 60 then by 60 again. 24 hours make up a day so to change etc. etc.... 
	Take a lap time of 1min 32sec 77 in milliseconds this is 9277 so:
		msec = 9277
		sec = msec/100 = 92
		min = sec/60 = 1

Now this doesn't look quite right does it I cant have a lap time of 1 min 92 sec 9277 it just isn't proper but how do I figure out how many minutes, seconds and milliseconds there are in 9277 msec. The answer is by using remainders there are 100 msec in a second so for 9277 I only want to display the last two digits of the time, well dividing 9277 by 100 I get a remainder of 77 this is perfect just the figure I want. But, how do I get the remainder of an expression using DIV. Well its done by using the arithmetic operator module ("%" or MOD() ). The % operator gives you the remainder of an expression, so 3/2=1 with a remainder of 1 the % operator ignores the answer to the expression and just gives the remainder, so 3%2=1, similarly 10/4=2 remainder 2 so 10%4=2, if there is no remainder the answer is zero so 10%2=0.
Now to use this to change the time so it looks more presentable.
    Milliseconds is the remainder of the timer divided by 100 or timer[]%100, seconds is the timer divided by 100(to change from milliseconds to seconds) and the remainder after division by 60 or (timer[]/100)%60, minutes is the timer first divided by 100 then divided by 60 and the remainder of a further division by 60 or (timer[]/100/60)%60.
 So for three variables MSEC,SECS and MINS I would have first MSEC=TIMER[0]%100, then for SECS I would have SECS=TIMER[0]/100%60 and finally for MINS I would have MINS=TIMER[0]/100/60%60. See program file included with this download.
    

