.Dd January 24, 2024
.Dt SQLITE3_SLEEP 3
.Os
.Sh NAME
.Nm sqlite3_sleep
.Nd suspend execution for a short time
.Sh SYNOPSIS
.In sqlite3.h
.Ft int
.Fo sqlite3_sleep
.Fa "int"
.Fc
.Sh DESCRIPTION
The sqlite3_sleep() function causes the current thread to suspend execution
for at least a number of milliseconds specified in its parameter.
.Pp
If the operating system does not support sleep requests with millisecond
time resolution, then the time will be rounded up to the nearest second.
The number of milliseconds of sleep actually requested from the operating
system is returned.
.Pp
SQLite implements this interface by calling the xSleep() method of
the default sqlite3_vfs object.
If the xSleep() method of the default VFS is not implemented correctly,
or not implemented at all, then the behavior of sqlite3_sleep() may
deviate from the description in the previous paragraphs.
.Pp
If a negative argument is passed to sqlite3_sleep() the results vary
by VFS and operating system.
Some system treat a negative argument as an instruction to sleep forever.
Others understand it to mean do not sleep at all.
In SQLite version 3.42.0 and later, a negative argument passed into
sqlite3_sleep() is changed to zero before it is relayed down into the
xSleep method of the VFS.
.Sh IMPLEMENTATION NOTES
These declarations were extracted from the
interface documentation at line 6398.
.Bd -literal
SQLITE_API int sqlite3_sleep(int);
.Ed
.Sh SEE ALSO
.Xr sqlite3_vfs 3