Skip to main content.
home | support | download

Back to List Archive

Re: Delay in spidering?

From: Bill Moseley <moseley(at)>
Date: Thu Dec 08 2005 - 12:43:50 GMT
On Thu, Dec 08, 2005 at 03:46:32AM -0800, François Tissandier wrote:
> Hello everybody
> I have a probably simple problem to solve:
> I'm spidering my content too quickly, I don't want my server to be at
> 100%. The delay_sec is not the solution as i'm using the keep_alive
> function. I read that I could enter a delay in the test_url function,
> but as my perl level is close to 0, I didn't find the solution. I tried
> a "sleep(0.5)", but it's not working. I need a very small delay, under a
> second, probably 0.2s or 0.1s. But it seems that sleep doesn't take any
> delay under a second... 


    perldoc Time::HiRes

       Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers

         use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep );

         usleep ($microseconds);
         nanosleep ($nanoseconds);

         ualarm ($microseconds);
         ualarm ($microseconds, $interval_microseconds);

Bill Moseley

Unsubscribe from or help with the swish-e list:

Help with Swish-e:
Received on Thu Dec 8 04:43:51 2005