Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How to sleep 1 microsecond?

by moritz (Cardinal)
on Aug 17, 2012 at 08:12 UTC ( #987934=note: print w/ replies, xml ) Need Help??


in reply to How to sleep 1 microsecond?

If you are on a modern operating system, you cannot do that reliably. Any kind of sleep call is likely to trigger a task switch where the OS puts your process in the background executes another one. And even if you don't sleep, that can still happen.

If you absolutely need such exact timings (what for?) consider using a real-time operating system, and probably not Perl either (Perl does some stuff under the hood that can be harmful when you need exact timings. Examples are re-hashing of hash tables, and freeing variables on scope exit).


Comment on Re: How to sleep 1 microsecond?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (18)
As of 2015-07-30 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls