Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Call function no more than every 0.1 seconds

by Marshall (Canon)
on Aug 12, 2020 at 03:18 UTC ( [id://11120638]=note: print w/replies, xml ) Need Help??


in reply to Re: Call function no more than every 0.1 seconds
in thread Call function no more than every 0.1 seconds

I like this idea. This Is like a "throttle" to reduce number of requests per second.
Sounds pretty good to me. But be aware that execution will not happen on .1 sec intervals.
  • Comment on Re^2: Call function no more than every 0.1 seconds

Replies are listed 'Best First'.
Re^3: Call function no more than every 0.1 seconds
by jcb (Parson) on Aug 13, 2020 at 01:08 UTC

    It will get very close. The delay is calculated after the work for "this" cycle has been done. The accuracy is limited by the accuracy of whatever you use to implement the delay, of course, and the system scheduler might preempt your process, but this can be limited by keeping the load reasonable. As I understand, a load average less than the number of processors means that all tasks are (on average) being run whenever they are not blocked.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120638]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found