I have two web requests that I need to poll to find out when they will return. Ideally, I do not want to constantly test them in a closed loop. I would like to free the processor so that other processes can execute.
I am currently using the Perl Time :: HiRes :: sleep (0.100) function to free the CPU before testing to see if web requests have returned.
During testing under load, I see that the duration of sleep is "stretched." Ideally, I want to make sure that the duration of sleep is respected, but this processor is freed. Should I call another function to achieve this?
I am coding Perl on Linux 2.6.
source
share