[Gambas-user] Sleep and Wait timing accuracy?

Benoît Minisini g4mba5 at gmail.com
Wed Feb 24 00:40:35 CET 2021


Le 23/02/2021 à 21:54, Jussi Lahtinen a écrit :
> Benoit, what is the expected accuracy for sleep and wait commands?
> +/- some constant?
> 
> Jussi

What do you mean exactly?

The Sleep instruction use the nanosleep() system call until the 
specified time has expired.

The Wait instruction calls the event loop. Event handlers can block it, 
so you have no guarantee at all on when Wait will return. You just can 
be sure that at least the specified time elapsed. The precision is at 
best one millisecond.

-- 
Benoît Minisini


More information about the User mailing list