gettimeofday.2: gettimeofday() is affected by discontinuous jumps in the system time

Advise reader to use clock_gettime(2), if they need a
monotonically increasing time source.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2012-04-25 12:57:59 +12:00
parent fb6fc61227
commit 5f04b9486b
1 changed files with 8 additions and 0 deletions

View File

@ -170,6 +170,14 @@ as obsolete, recommending the use of
.BR clock_gettime (2)
instead.
.SH NOTES
The time returned by
.BR gettimeofday (2)
.I is
affected by discontinuous jumps in the system time
(e.g., if the system administrator manually changes the system time).
If you need a monotonically increasing clock, see
.BR clock_gettime (2).
Macros for operating on
.I timeval
structures are described in