Possible Duplicate:
Ruby sleep or delay less than a second?
I have 100-1000 Threads running (or more). Each of those threads should execute a specific method at the exact same moment (most exact as possible).
The only solution I can think of is having each thread sleeping for the difference to a certain Timestamp, however sleep()
is not that accurate.
I was also thinking about using EventMachine
and EventMachine::Timer
instead, however this seems to be even less reliable and accurate.
What technique would you use to achieve the best results?