CompuServe Messages

Arexx timer help

    13-Oct-94 08:34:14
Sb: #43102-Arexx timer help
Fm: Jim Butterfield 73624,14
To: Charles Collinson 100014,1044
A little more information about your objective could be useful. Is the ARexx program to run free-standing? (That is, not connected to any other application's ARexx port)? How precise is the 1-second timing to be? Couuld it be allowed to drift a little, so that you might have, say, 58 or 62 events in a minute, or must it be locked to a timer? Anyway, here are some of the tools you will find useful for the activity you describe: Built-in function TIME(): when used in the form t=time('r') or t=time('e'), will report time elapsed in seconds/hundredthseconds (s.cc) since the last reset [last call to time('r')]. You can get quite precise timing from this, but if you wait in a loop [ DO WHILE time('e') < 1 ] you will be wasting the Amiga's processing time as you do so. You can also hook TIME() to the real-time clock: TIME('s') will return the integer number of seconds elapsed since midnight. Support function DELAY(): will 'sleep' the ARexx application for a selected number of 'ticks' (a tick being 1/50 second). Thus, CALL DELAY(50) will sleep this application for 1 second. Note that if you do significant processing work after awakening, a following DELAY(50) will make the total timing somewhat over 1 second. –Jim