]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/difftime.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / difftime.3
CommitLineData
fea681da
MK
1.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
4.\"
5.\" References consulted:
6.\" Linux libc source code
7.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
8.\" 386BSD man pages
9.\" Modified Sat Jul 24 19:48:17 1993 by Rik Faith (faith@cs.unc.edu)
4c1c5274 10.TH difftime 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
11.SH NAME
12difftime \- calculate time difference
b813014f
AC
13.SH LIBRARY
14Standard C library
15.RI ( libc ", " \-lc )
fea681da
MK
16.SH SYNOPSIS
17.nf
18.B #include <time.h>
68e4db0a 19.PP
fea681da
MK
20.BI "double difftime(time_t " time1 ", time_t " time0 );
21.fi
22.SH DESCRIPTION
60a90ecd
MK
23The
24.BR difftime ()
25function returns the number of seconds elapsed
6d275e3c
MK
26between time \fItime1\fP and time \fItime0\fP, represented as a
27.IR double .
f49c451a 28Each of the times is specified in calendar time, which means its
ef2e0660
MK
29value is a measurement (in seconds) relative to the
30Epoch, 1970-01-01 00:00:00 +0000 (UTC).
51f37626 31.SH ATTRIBUTES
22c9b12c
MK
32For an explanation of the terms used in this section, see
33.BR attributes (7).
c466875e
MK
34.ad l
35.nh
22c9b12c
MK
36.TS
37allbox;
c466875e 38lbx lb lb
22c9b12c
MK
39l l l.
40Interface Attribute Value
41T{
51f37626 42.BR difftime ()
22c9b12c
MK
43T} Thread safety MT-Safe
44.TE
c466875e
MK
45.hy
46.ad
47.sp 1
3113c7f3 48.SH STANDARDS
75ac82b9 49POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
fea681da 50.SH NOTES
c13182ef
MK
51On a POSIX system,
52.I time_t
f5f9a30c 53is an arithmetic type, and one could just
fea681da 54define
207050fa
MK
55.PP
56.in +4n
57.EX
2bc2f479 58#define difftime(t1,t0) (double)(t1 \- t0)
b9c93deb 59.EE
207050fa
MK
60.in
61.PP
fea681da 62when the possible overflow in the subtraction is not a concern.
47297adb 63.SH SEE ALSO
fea681da
MK
64.BR date (1),
65.BR gettimeofday (2),
66.BR time (2),
67.BR ctime (3),
68.BR gmtime (3),
69.BR localtime (3)