Time Manager


Mac
The macintosh Time Manager allows you to specify an interupt routine to be run at some time in the future. Similar to unix alarms. This task will get time regardless of which application is currently in the front, and what they are doing. For instance its a good way to get processing time, even if someone holds down the mouse in the menu bar.

The Time Manager allows you to specify a routine to be run after a certain amount of time has expired, with sub-millisecond precision. This task is called as an interupt, so of course your application A5 isnt valid. This means you can't get to your globals. Furthermore you cant arrange to restore the proper A5 without a little asm glue code.

The routines I define below make it easy to specify a TimeManager routine. In addition they do some work for you to reset the A5 that was active at the time they were called so that your globals will be in the right place. All without you having to think about any assembly to make it work.


TM_InstallTask() - Install a call back routine
TM_RemoveTask() - Remove a task
TM_ScheduleTask() - Do an installed task X milliseconds from now
TM_RescheduleTask() - Convenience routine to reschedule current task

Source and example for Mac (binhex) - /u/jedavis/src/lib/libmac/Examples/TimeManager.sit.hqx
Possibly newer versions of TimeManager.cp and TimeManager.h - /u/jedavis/src/lib/libmac


James Davis - jedavis@cs.stanford.edu