xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_sleep.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_SLEEP 3
3.Os
4.Sh NAME
5.Nm sqlite3_sleep
6.Nd suspend execution for a short time
7.Sh SYNOPSIS
8.In sqlite3.h
9.Ft int
10.Fo sqlite3_sleep
11.Fa "int"
12.Fc
13.Sh DESCRIPTION
14The sqlite3_sleep() function causes the current thread to suspend execution
15for at least a number of milliseconds specified in its parameter.
16.Pp
17If the operating system does not support sleep requests with millisecond
18time resolution, then the time will be rounded up to the nearest second.
19The number of milliseconds of sleep actually requested from the operating
20system is returned.
21.Pp
22SQLite implements this interface by calling the xSleep() method of
23the default sqlite3_vfs object.
24If the xSleep() method of the default VFS is not implemented correctly,
25or not implemented at all, then the behavior of sqlite3_sleep() may
26deviate from the description in the previous paragraphs.
27.Pp
28If a negative argument is passed to sqlite3_sleep() the results vary
29by VFS and operating system.
30Some system treat a negative argument as an instruction to sleep forever.
31Others understand it to mean do not sleep at all.
32In SQLite version 3.42.0 and later, a negative argument passed into
33sqlite3_sleep() is changed to zero before it is relayed down into the
34xSleep method of the VFS.
35.Sh IMPLEMENTATION NOTES
36These declarations were extracted from the
37interface documentation at line 6398.
38.Bd -literal
39SQLITE_API int sqlite3_sleep(int);
40.Ed
41.Sh SEE ALSO
42.Xr sqlite3_vfs 3
43