o Name: Jay Soffian o Email: [EMAIL PROTECTED] o Homepage: http://www.soffian.org/jay/ o Perfered user-ID: JSOFFIAN o Short description: See below:
SYNOPSIS use Time::RateLimit ':all'; calibrate(); # takes a second or two to complete $rate = 1/10; # 10 loops / second setrate($rate); while (1) { # ... } continue { delay(); # ratelimit loop to 10 loops / second } DESCRIPTION Time::RateLimit may be used to ratelimit a loop. Start by calling calibrate(). This must be done once and determines the resolution of nanosleep on your platform. setrate($rate) is then called just before entering your loop to set the rate to which you wish to limit your loop. Finally, call delay() within your loop to limit your maximum rate. j.