Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: timer.execute - Function Up: misc - Module Previous: plugins.attach - Function


timer - Tool



Package utility
Module misc


Postscript file available

Execute functions periodically, wait for a specified time

include "timer.g"

Constructors
Functions
execute execute a function periodically
remove remove a callback function from the timer
wait wait a specified amount of time



Description
timer is an tool which is used to execute a function periodically (or once after a timeout), or to wait for a specified period of time.

timer is a single tool, only one will be created in a given glish session. The timer is created the first time timer.g is included in a glish session.



Example
We can implement a simple ``reminder'' as follows:
- reminder := function(interval, name) { print 'Do not forget your meeting!'; }
-                                                # Run reminder every 5 minutes
- id := timer.execute(reminder, interval=300, oneshot=F)
- ... time passes ... the following message comes up every 5 minutes
Do not forget your meeting!
- ...
- timer.remove(id);   # Turn off reminder




next up previous contents index
Next: timer.execute - Function Up: misc - Module Previous: plugins.attach - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15