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)
29 .\" Japanese Version Copyright (c) 1997 NAGOYA Hiroaki
30 .\" all rights reserved.
31 .\" Translated Mon Feb 10 1997 by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
32 .\" Updated & Modified Sat Mar 23 23:57:43 JST 2002
33 .\" by Yuichi SATO <ysato@h4.dion.ne.jp>
37 .TH DIFFTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual"
40 .\"O difftime \- calculate time difference
41 difftime \- »þ¹ï¤Î´Ö³Ö¤Î·×»»
47 .BI "double difftime(time_t " time1 ", time_t " time0 );
53 .\"O function returns the number of seconds elapsed
54 .\"O between time \fItime1\fP and time \fItime0\fP, represented as a
56 .\"O Each of the times is specified in calendar time, which means its
57 .\"O value is a measurement (in seconds) relative to the
58 .\"O Epoch, 1970-01-01 00:00:00 +0000 (UTC).
61 ¤Ï»þ¹ï \fItime0\fP ¤«¤é
62 »þ¹ï \fItime1\fP ¤Þ¤Ç¤Î·Ð²á»þ´Ö¤ò
64 ·¿¤ÇÊÖ¤¹¡£³Æ¡¹¤Î»þ¹ï¤Ï¥«¥ì¥ó¥À¡¼»þ´Ö¤Ç»ØÄꤹ¤ë¡£
65 ¤Ä¤Þ¤ê¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î
66 ·Ð²á»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤹ¤ë¡£
67 .\"O .SH "CONFORMING TO"
69 SVr4, 4.3BSD, C89, C99.
72 .\"O On a POSIX system,
74 .\"O is an arithmetic type, and one could just
78 ¤Ï¿ôÃÍ·¿¤Ê¤Î¤Ç¡¢°ú¤»»¤ÎºÝ¤Ëµ¯¤³¤ë²ÄǽÀ¤Î¤¢¤ë¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ò
79 µ¤¤Ë¤·¤Ê¤¤¾ì¹ç¤Ï¡¢Ã±½ã¤Ë
83 #define difftime(t1,t0) (double)(t1 \- t0)
87 .\"O when the possible overflow in the subtraction is not a concern.
89 .\"O On other systems, the data type
91 .\"O might use some other encoding
92 .\"O where subtraction doesn't work directly.
93 ¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥Ç¡¼¥¿·¿
95 ¤Ë²¿¤«Ê̤Υ¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤¬»È¤ï¤ì¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ê¡¢
96 ¤½¤Î¾ì¹ç¤Ë¤ÏľÀÜ°ú¤»»¤ò¹Ô¤¦¤³¤È¤Ï¤Ç¤¤Ê¤¤¡£
100 .BR gettimeofday (2),