Ruby sleep in milliseconds
The short answer is sleep(0.0001) for a millisecond.
The details are that it's not that simple. Depending on your platform(OS) and details on thread sleeping, which I won't go into. When you get under a second and definitely under a tenth of a second accuracy really goes down the tubes. On some computers you won't see it work on less than a second. This is a complaint on some message boards. If you need much better accuracy look into realtime linux as your OS.
sleep(0.0001)
The details are that it's not that simple. Depending on your platform(OS) and details on thread sleeping, which I won't go into. When you get under a second and definitely under a tenth of a second accuracy really goes down the tubes. On some computers you won't see it work on less than a second. This is a complaint on some message boards. If you need much better accuracy look into realtime linux as your OS.
Comments
A redundant zero.
1 millisecond would be "sleep(0.001)"