[fpc-pascal] RTLEventWaitFor

José Mejuto joshyfun at gmail.com
Tue Apr 5 12:02:57 CEST 2022

El 05/04/2022 a las 1:03, Mattias Gaertner via fpc-pascal escribió:
> Hi Michael,
> Under Linux a RTLEventWaitFor(e,1) usually waits at most 1ms. But under
> Windows it usually waits at least 15ms. It seems to round to nearest
> 1/64 of a second.
> Googling this lead me to question the sanity of some bloggers.
> Has anyone an idea if this is normal on Windows and if there is an
> alternative?
> Mattias


On Windows the timer resolution is 1/64, that's 15,6 ms. You can change 
it by using "NtSetTimerResolution" but it is system wide and other 
programs can fail or have strange behaviour. MS recommends to not change 
it, but some programs like Chrome do it for some chuncks of time.

You can check the 15.6 ms using a tight loop of GetTickCount.

Have a nice day.


More information about the fpc-pascal mailing list