]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/difftime.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / difftime.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
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)
10 .TH DIFFTIME 3 2021-03-22 "Linux man-pages (unreleased)"
11 .SH NAME
12 difftime \- calculate time difference
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .B #include <time.h>
19 .PP
20 .BI "double difftime(time_t " time1 ", time_t " time0 );
21 .fi
22 .SH DESCRIPTION
23 The
24 .BR difftime ()
25 function returns the number of seconds elapsed
26 between time \fItime1\fP and time \fItime0\fP, represented as a
27 .IR double .
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).
31 .SH ATTRIBUTES
32 For an explanation of the terms used in this section, see
33 .BR attributes (7).
34 .ad l
35 .nh
36 .TS
37 allbox;
38 lbx lb lb
39 l l l.
40 Interface Attribute Value
41 T{
42 .BR difftime ()
43 T} Thread safety MT-Safe
44 .TE
45 .hy
46 .ad
47 .sp 1
48 .SH STANDARDS
49 POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
50 .SH NOTES
51 On a POSIX system,
52 .I time_t
53 is an arithmetic type, and one could just
54 define
55 .PP
56 .in +4n
57 .EX
58 #define difftime(t1,t0) (double)(t1 \- t0)
59 .EE
60 .in
61 .PP
62 when the possible overflow in the subtraction is not a concern.
63 .SH SEE ALSO
64 .BR date (1),
65 .BR gettimeofday (2),
66 .BR time (2),
67 .BR ctime (3),
68 .BR gmtime (3),
69 .BR localtime (3)