wasm-demo/demo/ermis-f/python_m/cur/0792

30 lines
1.0 KiB
Plaintext

From: Stuart.Ramsden at anu.edu.au (Stuart Ramsden)
Date: Wed, 14 Apr 1999 10:26:44 +1000
Subject: real time scheduler
References: <3713AE36.A1EA255B@arlut.utexas.edu>
Message-ID: <3713E0C4.2AD4FCCB@anu.edu.au>
X-UID: 792
Bryan VanDeVen wrote:
> Is there a module for scheduling events in real time? I have events
> that need to be repeated indefinitely, each at a given time period. The
> periods are large (at least one minute) and precision requirements are
> not that great (within a few seconds). Is anyone aware of code to do
> this?
I wrote a midi scheduler based on the priority queues described in
Guido's python book. My biggest problem was the latency - I tried
a few mechanisms, including tk's 'after' and a mixture of long and short
sleeps - the best was a tight loop polling for the next time event.
Have a look at the source and ignore the midi stuff (will only run under
SGI and Python 1.2-1.4 anyway)
http://anusf.anu.edu.au/~sjr/midiplayer.py