Contents

Class Delay


Inheritance:

Object  »
  Delay

Delay implements a facility to pause a process for some amount of time. The simplest usage is like this:

(Delay forSeconds: 5) wait.

An instance of Delay responds to the message wait by suspending the caller's process for a certain amount of time. The duration of the pause is specified when the Delay is created with the message forMilliseconds: or forSeconds:. A Delay can be used again when the current wait has finished. For example, a clock process might repeatedly wait on a one-second Delay.

The maximum delay is (SmallInteger maxVal // 2) milliseconds, or about six days. A delay in progress when an image snapshot is saved is resumed when the snapshot is re-started. Delays work across millisecond clock roll-overs.

Class Variables:

The following class variables are used to manage all currently active delays:

Instance Variables:

Note that it is not allowed to specify a delay with a negative amount of time. An error notification is shown when you try to create a Delay with a negative amount of time. When you have to delay a process for a computed amount of time, you should always write something like this:

Delay forMilliseconds: (computedValue max: 0).

Contents