Re: (sort of) deterministic timing in Python

2007-08-17 Thread Chris Mellon
On 8/17/07, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > > "Paul Rubin" wrote: > > > >[EMAIL PROTECTED] (John Fisher) writes: > >> mark start time > >> start event > >> event finishes > >> count time until next interval > >> start second event… > >> > >> rather than this:

Re: (sort of) deterministic timing in Python

2007-08-17 Thread Hendrik van Rooyen
"Paul Rubin" wrote: >[EMAIL PROTECTED] (John Fisher) writes: >> mark start time >> start event >> event finishes >> count time until next interval >> start second event… >> >> rather than this: >> >> start event >> event finishes >> sleep for interval >> start s

Re: (sort of) deterministic timing in Python

2007-08-16 Thread Paul Rubin
[EMAIL PROTECTED] (John Fisher) writes: > mark start time > start event > event finishes > count time until next interval > start second event… > > rather than this: > > start event > event finishes > sleep for interval > start second event > ... > So how do I accomplish this in

Re: (sort of) deterministic timing in Python

2007-08-14 Thread Hendrik van Rooyen
"John Fisher" wrote: import time period_time = TIME_CONSTANT # The time of a period in seconds - 0.001 is a millisec >mark start time start_time = time.time() >start event >event finishes event_time = time.time() - start_time wait_time = period_time-event_time >count time until next

Re: (sort of) deterministic timing in Python

2007-08-13 Thread [EMAIL PROTECTED]
On Aug 13, 5:16 pm, [EMAIL PROTECTED] (John Fisher) wrote: > I am working on a framework for data acquisition in Python 2.5, am > trying to get a structure going more like this: > > mark start time > start event > event finishes > count time until next interval > start second event... > > r

Re: (sort of) deterministic timing in Python

2007-08-13 Thread Matimus
> Do you see the difference? I get a true fixed interval from the first, > including the time to accomplish the event task(s). In the second case, > the sleep just gets tacked on at the end of the events, not very > deterministic (timing-wise). Check out the sched (scheduler) module http://docs.p