1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" References consulted:
6 .\" Linux libc source code
7 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" Modified Sat Jul 24 19:48:17 1993 by Rik Faith (faith@cs.unc.edu)
10 .TH DIFFTIME 3 2021-03-22 "Linux man-pages (unreleased)"
12 difftime \- calculate time difference
15 .RI ( libc ", " \-lc )
20 .BI "double difftime(time_t " time1 ", time_t " time0 );
25 function returns the number of seconds elapsed
26 between time \fItime1\fP and time \fItime0\fP, represented as a
28 Each of the times is specified in calendar time, which means its
29 value is a measurement (in seconds) relative to the
30 Epoch, 1970-01-01 00:00:00 +0000 (UTC).
32 For an explanation of the terms used in this section, see
40 Interface Attribute Value
43 T} Thread safety MT-Safe
49 POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
53 is an arithmetic type, and one could just
58 #define difftime(t1,t0) (double)(t1 \- t0)
62 when the possible overflow in the subtraction is not a concern.