Important: The information in this document is obsolete and should not be used for new development.
The Original Time Manager
The Time Manager was first introduced with the Macintosh Plus ROMs (which are also used in Macintosh 512K enhanced models) and was intended for use internally by the Operating System. The original Time Manager allows delays as small as 1 millisecond, resulting in a maximum range of about 24 days.To schedule a task for later execution, place an entry into the Time Manager queue and then activate it. All Time Manager routines manipulate elements of the Time Manager queue, which are stored in a Time Manager task record. The task record for the original Time Manager is defined by the
TMTask
data type.
TYPE TMTask = {original and revised Time Manager task record} RECORD qLink: QElemPtr; {next queue entry} qType: Integer; {queue type} tmAddr: ProcPtr; {pointer to task} tmCount: LongInt; {reserved} END;Of the four fields in this record, you need to fill in only thetmAddr
field, which contains a pointer to the routine that is to be executed at some time in the future. The remaining fields are used internally by the Time Manager or are reserved by Apple Computer, Inc. However, you should set thetmCount
field to 0 when you set up a task record.The original Time Manager includes three routines:
Note that installing a request into the Time Manager queue (by calling the
- The
InsTime
procedure installs a task record into the Time Manager queue.- The
PrimeTime
procedure schedules a previously queued task record for future execution.- The
RmvTime
procedure removes a task record from the Time Manager queue.
InsTime
procedure) does not by itself schedule the specified routine for future execution. After you queue a request, you still need to activate (or prime) the request by specifying the desired delay until execution (by calling thePrimeTime
procedure). Note also that the task record is not automatically removed from the Time Manager queue after the routine is executed. For this reason, you can reactivate the task by subsequent calls toPrimeTime
; you do not have to reinstall the task record.To remove a task record from the queue, you must call the
RmvTime
procedure. TheRmvTime
procedure removes a task record from the Time Manager queue whether or not that task was ever activated and whether or not its specified time delay has expired.