Skip to main content.
home | support | download

Back to List Archive

Re: Delay in spidering?

From: Bill Moseley <moseley(at)not-real.hank.org>
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... 

Try:

    perldoc Time::HiRes

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

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

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

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

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Thu Dec 8 04:43:51 2005