Title:

setInterval() - set the delay between successive evaluations of a task for a waitThread object. The main purpose of this function is to allow an idle waitThread to be parameterized after creation such as after new("waitThread"). We are allowing access to this, but don't envisage it being used much.

Usage:

setInterval(thread=self(), interval=1 )

Arguments:

thread:
interval:

Side Effect:

a request to set the interval object for this thread is queued. This will not be processed until the existing timer has completed. If the timer repeats indefinitely, this request will never take place. (We could make it, but that would be incosistent.) One can think of the waitThread being created with a task queue of length corresponding to number of times the task is to performed. This is the length() of the argument interval or repeat , unless the latter is T in which case the length is infinite. The request to set the interval value is added to the end of this list and can only take effect then.

If one wants to change the interval value during a sequence of repeated tasks, cancel() the thread and start a new one. The expression for the task can be retrieved using threadQueue

What should the return value for threadQueue in the case of a virtual infinite queue? Should pass back interval also and the current number of repetitions completed.

See Also:

waitThread
waitThread
cancel

Examples:

      timerThread = waitThread(1, Quote(print(i=i+1)),data=list(i=1))
       ..
       ..
      setInterval(timerThread, 2)

Key Words:

User Level Threads

Last modified: Fri Feb 7 09:42:39 1997