
-----------------------------------
Artimes
Thu Nov 06, 2003 10:29 pm

Timer
-----------------------------------
This is a simple timer for all of you!



% Timer
% Created by: John Baker
% Created on: November 5th, 2003
% This program is a timer that counts seconds, minutes, and hours

var seconds, minutes, hours : int := 0

    loop

        put "Time " : 5, hours : 2, ":", minutes : 2, ":", seconds : 2

        delay (1000)

        seconds := seconds + 1

        if seconds = 60 then

            seconds := 0

            minutes := minutes + 1

        elsif minutes = 60 then

            minutes := 0

            hours := hours + 1

        end if

        cls

    end loop



-----------------------------------
Dan
Fri Nov 07, 2003 5:19 pm


-----------------------------------
this whould wrok alot better if you used turings time fuctions. that way it will be real time rather then dependedt on the speed of your computer.

ex.


var startTime:int:=Time.Sec 
var endTime:int:= 120 %put time in secondes to run
var curent:int

loop
    curent := Time.Sec  - startTime
    
    exit when curent >= endTime 
end loop


-----------------------------------
Artimes
Sat Nov 08, 2003 12:33 am


-----------------------------------
Kewl, well I was just trying to show my skills some how...
