Timer

From BR Wiki
Revision as of 14:11, 15 January 2012 by Mikhail.zheleznov (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 TIMER 

The Timer internal function returns a "Real Number" with 5 decimal digits accuracy with the number of seconds elapsed since a point in time roughly around 1970.

This value is used internally by the pro filer to monitor performance, but may be used within programs to measure the time very accurately

The function works as far back as 4.1x.

Simple Example:

PRINT TIMER
Returns:  1305192990.17052

The following example shows the timer value, and converts it to various units "Minutes" "Hours" "Years". It also shows the total time elapsed for this program. (It usually returns 0.0156004) With 1 Attempt.

00001   PRINT Newpage
00010   LET Tot_Time=Timer
00020   PRINT "Timer:",Tot_Time
00030   PRINT "Minutes:",Int(Tot_Time/60)
00040   PRINT "Hours:",Int(Tot_Time/(60*60))
00050   PRINT "Years:",(Tot_Time/(60*60*24*365))
00060   LET New_Time=Timer
00065   IF (New_Time-Tot_Time)=0 THEN LET Attempts+=1 : GOTO 60
00070   PRINT "Time Elapsed: (";Attempts+1;")",New_Time-Tot_Time