]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
3 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
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 (faith@cs.unc.edu) | |
4c1c5274 | 11 | .TH difftime 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
12 | .SH NAME |
13 | difftime \- calculate time difference | |
b813014f AC |
14 | .SH LIBRARY |
15 | Standard C library | |
16 | .RI ( libc ", " \-lc ) | |
fea681da MK |
17 | .SH SYNOPSIS |
18 | .nf | |
19 | .B #include <time.h> | |
c6d039a3 | 20 | .P |
fea681da MK |
21 | .BI "double difftime(time_t " time1 ", time_t " time0 ); |
22 | .fi | |
23 | .SH DESCRIPTION | |
60a90ecd MK |
24 | The |
25 | .BR difftime () | |
26 | function returns the number of seconds elapsed | |
6d275e3c MK |
27 | between time \fItime1\fP and time \fItime0\fP, represented as a |
28 | .IR double . | |
7f652f51 PE |
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 . | |
51f37626 | 36 | .SH ATTRIBUTES |
22c9b12c MK |
37 | For an explanation of the terms used in this section, see |
38 | .BR attributes (7). | |
39 | .TS | |
40 | allbox; | |
c466875e | 41 | lbx lb lb |
22c9b12c MK |
42 | l l l. |
43 | Interface Attribute Value | |
44 | T{ | |
9e54434e BR |
45 | .na |
46 | .nh | |
51f37626 | 47 | .BR difftime () |
22c9b12c MK |
48 | T} Thread safety MT-Safe |
49 | .TE | |
3113c7f3 | 50 | .SH STANDARDS |
4131356c AC |
51 | C11, POSIX.1-2008. |
52 | .SH HISTORY | |
53 | POSIX.1-2001, C89, SVr4, 4.3BSD. | |
47297adb | 54 | .SH SEE ALSO |
fea681da MK |
55 | .BR date (1), |
56 | .BR gettimeofday (2), | |
57 | .BR time (2), | |
58 | .BR ctime (3), | |
59 | .BR gmtime (3), | |
60 | .BR localtime (3) |