Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Processes
Chapter 3 - Time Manager / About the Time Manager

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}
      qLink:      QElemPtr;      {next queue entry}
      qType:      Integer;       {queue type}
      tmAddr:     ProcPtr;       {pointer to task}
      tmCount:    LongInt;       {reserved}
Of the four fields in this record, you need to fill in only the tmAddr 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 the tmCount 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 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 the PrimeTime 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 to PrimeTime; you do not have to reinstall the task record.

To remove a task record from the queue, you must call the RmvTime procedure. The RmvTime 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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996