1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
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 .\" Modified Sat Jul 24 21:27:01 1993 by Rik Faith (faith@cs.unc.edu)
24 .\" Modified 14 Jun 2002, Michael Kerrisk <mtk.manpages@gmail.com>
25 .\" Added notes on differences from other UNIX systems with respect to
26 .\" waited-for children.
28 .\" Japanese Version Copyright (c) 1996 Hiroaki Nagoya
29 .\" all rights reserved.
30 .\" Translated Mon Feb 3 15:35:19 JST 1997
31 .\" by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
32 .\" Updated Fri Sep 27 JST 2002 by Kentaro Shirakata <argrath@ub32.org>
33 .\" Updated 2007-05-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.48
35 .\"WORD: processor time プロセッサ時間
36 .\"WORD: CPU time CPU時間
38 .TH CLOCK 3 2008-08-28 "GNU" "Linux Programmer's Manual"
41 .\"O clock \- Determine processor time
48 .B clock_t clock(void);
54 .\"O function returns an approximation of processor time used by the program.
56 はプログラムの使用したプロセッサ時間の近似値を返す。
57 .\"O .SH "RETURN VALUE"
59 .\"O The value returned is the CPU time used so far as a
61 .\"O to get the number of seconds used, divide by
62 .\"O .BR CLOCKS_PER_SEC .
63 .\"O If the processor time used is not available or its value cannot
64 .\"O be represented, the function returns the value
65 .\"O .IR (clock_t)\ \-1 .
72 使用したプロセッサ時間が得られない場合や、その値を表現できない場合、
76 .\"O .SH "CONFORMING TO"
78 .\"O C89, C99, POSIX.1-2001.
79 .\"O POSIX requires that
80 .\"O .B CLOCKS_PER_SEC
81 .\"O equals 1000000 independent
82 .\"O of the actual resolution.
83 C89, C99, POSIX.1-2001.
86 が 1000000 であることを要求している。
89 .\"O The C standard allows for arbitrary values at the start of the program;
90 .\"O subtract the value returned from a call to
92 .\"O at the start of the program to get maximum portability.
93 C の標準規格ではプログラムの開始の時点ではどんな値が返ってきても
95 移植性を最大限確保するためには、プログラムの開始時に
99 .\"O Note that the time can wrap around.
100 .\"O On a 32-bit system where
101 .\"O .B CLOCKS_PER_SEC
102 .\"O equals 1000000 this function will return the same
103 .\"O value approximately every 72 minutes.
104 時刻は桁あふれする可能性がある点に注意すること。
106 が 1000000 である 32 ビットシステムでは、
107 この関数は約 72 分毎に同じ値を返すことになる。
109 .\"O On several other implementations,
110 .\"O the value returned by
112 .\"O also includes the times of any children whose status has been
115 .\"O (or another wait-type call).
120 (あるいはその他の wait のような関数) で収集された
122 .\"O Linux does not include the times of waited-for children in the
123 .\"O value returned by
127 が返す値には wait された子プロセスの時間は含まれない。
128 .\" I have seen this behavior on Irix 6.3, and the OSF/1, HP/UX, and
129 .\" Solaris manual pages say that clock() also does this on those systems.
130 .\" POSIX.1-2001 doesn't explicitly allow this, nor is there an
131 .\" explicit prohibition. -- MTK
134 .\"O function, which explicitly returns (separate) information about the
135 .\"O caller and its children, may be preferable.
137 関数は呼び出し元とその子プロセスに関する情報を
138 (別々に) 明示的に返すので、より好ましいだろう。
141 .BR clock_gettime (2),