1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 19:48:17 1993 by Rik Faith (faith@cs.unc.edu)
28 .\"*******************************************************************
30 .\" This file was generated with po4a. Translate the source file.
32 .\"*******************************************************************
33 .TH DIFFTIME 3 2010\-02\-25 GNU "Linux Programmer's Manual"
38 \fB#include <time.h>\fP
40 \fBdouble difftime(time_t \fP\fItime1\fP\fB, time_t \fP\fItime0\fP\fB);\fP
43 関数 \fBdifftime\fP() は時刻 \fItime0\fP から 時刻 \fItime1\fP までの経過時間を \fIdouble\fP
44 型で返す。各々の時刻はカレンダー時間で指定する。 つまり、紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの
47 SVr4, 4.3BSD, C89, C99.
49 POSIX システムでは \fItime_t\fP は数値型なので、引き算の際に起こる可能性のあるオーバーフローを 気にしない場合は、単純に
53 #define difftime(t1,t0) (double)(t1 \- t0)
57 と定義できる。 他のシステムでは、データ型 \fItime_t\fP に何か別のエンコーディングが使われていることがあり、
58 その場合には直接引き算を行うことはできない。
60 \fBdate\fP(1), \fBgettimeofday\fP(2), \fBtime\fP(2), \fBctime\fP(3), \fBgmtime\fP(3),