TMR( ) |
Timer |
TMR(tmr_code[,ERR=stmtref])
tmr_code |
Value indicating what type of information to be returned. Numeric expression, integer range 0 to 3. |
stmtref |
Program line number or statement label to which to transfer control. |
Number of seconds (or hours if tmr_code is 2) since last timer setting or start of session.
The TMR( ) function can initialize the timer (to 0) and return the time difference in seconds or hours since the last initialization. The TMR( ) function is used as follows:
|
Returns the difference in seconds since the last TMR(0) and resets the timer to 0. | |
|
Returns the difference in seconds since the last timer reset or start of session. | |
|
Returns the difference in hours since the last timer reset or start of session. | |
|
TMR(3) |
Returns the time in seconds since start of the session. |
(The TMR(3) functionality was added in PxPlus v7.00.)
print 'CS'
a=tmr(0)
button 10,@(1,1,20,2)="TMR System Function"
while 1
obtain x
if ctl=10 \
then gosub ShowTime
if ctl=4 \
then break
wend
end
ShowTime:
print @(1,20),"Number of seconds since last occurrence of TMR(0):",tmr(1)
print @(1,21),"Number of hours since last occurrence of TMR(0):",tmr(2)
a=tmr(0)
return