in reply to Re: Waiting for Alarm
in thread Waiting for Alarm
For a bit more context, I'm taking measurements from electronic test equipment using the GPIB bus. I want to take those readings, say, every 10 seconds. The time it takes to tell the instrument to send a reading, for the instrument to process that request, and then return the result, is somewhat variable. So it's very hard to calibrate the sleep time to keep accuracy.
What I want to do is trigger the measurement cycle every X seconds regardless of how long (less than X, obviously) the measurement process takes.
In one previous iteration, I used HiRes gettime calls before and after the read/write cycle to determine how long the processing took, and used that to adjust the sleep time, but that seemed an awfully awkward way to go. I was hoping that a recurring alarm (which the HiRes setItimer function allows) would be a more elegant way to go.
Thanks! Hope this helps clarify.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Waiting for Alarm
by BrowserUk (Patriarch) on Feb 16, 2008 at 19:24 UTC | |
by bobf (Monsignor) on Feb 17, 2008 at 03:52 UTC | |
by BrowserUk (Patriarch) on Feb 17, 2008 at 04:25 UTC | |
|
Re^3: Waiting for Alarm
by pc88mxer (Vicar) on Feb 17, 2008 at 17:29 UTC |