21 Aug
2013
21 Aug
'13
3:43 p.m.
Gav Wood wrote:
The default 'blind' prior is a simple exponential expectation whereby we assume for any given duration of waiting 't', that the expected completion time is 2t; i.e. we expect to wait as long as we have already been waiting. As such, the optimum time to start with the 'sleep(1)' strategy (which from my tests sleeps for a full 20ms timeslice) is after 20ms, (only after which point the prior leads us to assert that the completion will probably take at least another 20ms).
For a 20ms timeslice, this means that one should Sleep(1) after 10ms of Sleep(0). But the timeslice is not necessarily 20ms. A call to timeBeginPeriod(1) may shorten it.