|
|
|
Run a cron process more than every minute
Something like this is the way to go if only shell tools are to be used, but this solution has problems. If the open is fast enough, the time in seconds might be the same multiple of dt that it was before. Then sleep 0 will be executed and the open will be executed too soon. A quick fix would be to test for 0 sleep times and change them to dt. Better would be to monitor the execution starts explicitly. Get the time at the beginning, say "start" and at iteration i sleep until time start+dt*i where the first iteration is i=1.
Run a cron process more than every minute
The expression "${dt} - \( ${now} % ${dt} \)" always gives a value from 1 to 15 (for dt = 15). The '%' operator takes the remainder when now is divided by 15, which is always in the range 0-14 , and 15 minus that puts it in the 15-1 range, respectively. |
SearchFrom our Sponsor...Latest Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2013 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.37 seconds |
|