Debian Codegraph @

upstream/debian-trixie/man3/difftime.3

raw
1 '\" t
2 .\" Copyright 1993 David Metcalfe ([email protected])
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" 386BSD man pages
10 .\" Modified Sat Jul 24 19:48:17 1993 by Rik Faith ([email protected])
11 .TH difftime 3 2024-05-02 "Linux man-pages 6.9.1"
12 .SH NAME
13 difftime \- calculate time difference
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <time.h>
20 .P
21 .BI "double difftime(time_t " time1 ", time_t " time0 );
22 .fi
23 .SH DESCRIPTION
24 The
25 .BR difftime ()
26 function returns the number of seconds elapsed
27 between time \fItime1\fP and time \fItime0\fP, represented as a
28 .IR double .
29 Each time is a count of seconds.
30 .P
31 .I difftime(b,\~a)
32 acts like
33 .I (b\-a)
34 except that the result does not overflow and is rounded to
35 .IR double .
36 .SH ATTRIBUTES
37 For an explanation of the terms used in this section, see
38 .BR attributes (7).
39 .TS
40 allbox;
41 lbx lb lb
42 l l l.
43 Interface Attribute Value
44 T{
45 .na
46 .nh
47 .BR difftime ()
48 T} Thread safety MT-Safe
49 .TE
50 .SH STANDARDS
51 C11, POSIX.1-2008.
52 .SH HISTORY
53 POSIX.1-2001, C89, SVr4, 4.3BSD.
54 .SH SEE ALSO
55 .BR date (1),
56 .BR gettimeofday (2),
57 .BR time (2),
58 .BR ctime (3),
59 .BR gmtime (3),
60 .BR localtime (3)