Open MarSe32m opened 1 year ago
This is very difficult to support. IIRC, the default time quanta on Windows is 10ms (or was it 15ms?). In theory you can do some things that get you a higher resolution (at least in the kernel). However, that will significantly impact battery life. This might require an evolution proposal to explicitly opt-in to a power impacting higher resolution timer beyond the system default.
It's also worth noting that {Suspending,Continuous}Clock.measure {}
has coarser granularity on Windows than on e.g. Darwin.
Description Sleeping a task on Windows for relatively small time intervals, e.g. < 10ms, is inaccruate even when one uses
timeBeginPeriod()
.Steps to reproduce The following code
prints
Expected behavior It should print something like
0.001.. seconds
.Using
Thread.sleep()
from Foundation gives the expected result.Environment
but this happens also on other versions of the compiler (5.6.*, 5.7.*, 5.8).