ClassPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Moderately revised from 8.0.
8.0 version

timer

See cg-timers.htm.

The class of timer objects. A timer can be used to cause an arbitrary piece of application code to be asynchronously invoked after a specified amount of time has elapsed. A timer can then be stopped in order to run its code a single time only, or it can be allowed to continue running in order to run its code an indefinite number of times at a regular time interval.

A single timer can be started and stopped a number of times, using various time intervals, to time a number of different activities. If multiple activities need to be timed simultaneously, then multiple timers can be created and run alongside each other. It is also convenient to create a separate timer for each piece of code that is to be invoked by timers, even when they do not need to run simultaneously.

A timer has the following properties. All of these except for id may be set by an application.

name: an arbitrary symbol that is used to find a timer (by calling find-timer), or to distinguish an individual timer during development and debugging.

active: a boolean value indicating whether a timer is currently running: an active timer "fires" each time its interval passes, while an inactive timer does nothing. This property of a timer will be non-nil if start-timer has been called on the timer more recently than stop-timer has. If the active property is explicitly modified by an application from nil to non-nil, then start-timer is called internally, and if the active property is explicitly modified from non-nil to nil, then stop-timer is called internally. Therefore, in order to wrap all starting and stopping of timers, it is sufficient to add start-timer and stop-timer methods.

id: a positive integer that is assigned and used by the operating system to uniquely identify a particular timer. Use of id is deprecated. An application should never modify this property. Any given timer object will always use the same id, and no other timer object will use that id.

interval: a positive integer indicating the number of milliseconds after a timer is started that it will "fire" by calling the generic function timer. The interval default-initarg for the timer class is 1000, which will fire the timer once a second.

on-timer: the name of a function that is invoked after the timer's interval has elapsed (assuming that the default timer method has not been overridden).

timer-count: a non-negative integer indicating the number of times that a timer's interval has elapsed since it was most recently started.

timer-info: a place for an application to store arbitrary information about its current use of a timer.

timer-universal-time: the universal time at which the timer is scheduled to fire, or nil if the timer is not active.

GTK Note

See *cg-timer-resolution*.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had moderate revisions compared to the 8.0 page.
Created 2007.4.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Moderately revised from 8.0.
8.0 version