Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987934]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-05-25 11:24 GMT
Find Nodes?
    Voting Booth?