in reply to cron-like timing within perl script?
while (1) { next_time=time+60; get_data_taking_55_seconds_give_or_take_a_few; sleep next_time-time; write_log_file; }
Note that you will still have a +/- 1 second drift, so the exact time of measurements would still drift.
For higher accuracy, you pre-determine the times:
next_time=time; while (1) { next_time=next_time+60; get_data_taking_55_seconds_give_or_take_a_few; sleep next_time-time; write_log_file; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: cron-like timing within perl script?
by Anonymous Monk on Feb 28, 2004 at 20:06 UTC | |
by merlyn (Sage) on Feb 28, 2004 at 20:11 UTC | |
by n8ur (Acolyte) on Feb 28, 2004 at 20:08 UTC |