This is what I found and would love for someone else to validate this, but this is what I found while reading the Reference Source for ManualResetEventSlim
ManualResetEventSlim
It is attempting to just sleep and yield based on the number of processors and doing extremely short sleeps -- 1ms or 0ms depending on its current spin index. If it still hasn't been enough time, it will then revert to using Monitor.Wait
using a new updated version of the timeout that was originally passed in.
Passing in 0 for Thread.Sleep relieves its time slice.
ManualResetEvent
It uses WaitHandle
and calls native methods to handle waiting for the specified time. Unfortunately, I am unable to see what it is doing.
My Conclusion
"Very Short" means just a few milliseconds.
EDIT: I just found these which have lots of information:
ManualResetEventSlim
. Otherwise I'll useManualResetEvent
. If you're writing a performance sensitive application, you should test your code with both to determine if there's any difference. If you're not counting microseconds, then it's probably a waste of time to worry about which one is faster. – Across