in reply to making a loop script with a remote URL call faster
I'm not sure what you mean, obviously you want to poll only every 60 seconds.
Personally I'd prefer sleep 60; instead of burning the CPU with an infinite loop.
Your script will wake up in time, and other processes can use the CPU in the meantime.
Now if your problem is that Net::Curl takes too long, measure that time and subtract it sleep 60-$lastcurl;
You'll need Time::HiRes for that kind of accuracy.
use Time::HiRes qw (time sleep );
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: making a loop script with a remote URL call faster
by brandonm78 (Initiate) on Jan 15, 2022 at 02:45 UTC | |
by LanX (Saint) on Jan 15, 2022 at 13:58 UTC | |
by cavac (Prior) on Jan 16, 2022 at 20:22 UTC | |
by cavac (Prior) on Jan 16, 2022 at 21:04 UTC | |
by haukex (Archbishop) on Jan 18, 2022 at 13:41 UTC | |
by LanX (Saint) on Jan 16, 2022 at 23:43 UTC | |
by cavac (Prior) on Jan 17, 2022 at 15:47 UTC | |
|