OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / clock.3
index 2198a42..f626c5a 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
-.\" License.
+.\" %%%LICENSE_END
+.\"
 .\" Modified Sat Jul 24 21:27:01 1993 by Rik Faith (faith@cs.unc.edu)
 .\" Modified 14 Jun 2002, Michael Kerrisk <mtk.manpages@gmail.com>
-.\"    Added notes on differences from other Unix systems with respect to
+.\"    Added notes on differences from other UNIX systems with respect to
 .\"    waited-for children.
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
 .\" Japanese Version Copyright (c) 1996 Hiroaki Nagoya
 .\"         all rights reserved.
-.\" Tranlated Mon Feb  3 15:35:19 JST 1997
+.\" Translated Mon Feb  3 15:35:19 JST 1997
 .\"         by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
 .\" Updated Fri Sep 27 JST 2002 by Kentaro Shirakata <argrath@ub32.org>
 .\" Updated 2007-05-28, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.48
 .\"
-.\"WORD: processor time   ¥×¥í¥»¥Ã¥µ»þ´Ö
-.\"WORD: CPU time         CPU»þ´Ö
-.\"
-.TH CLOCK 3  2008-08-28 "GNU" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O clock \- Determine processor time
-clock \- ¥×¥í¥»¥Ã¥µ»þ´Ö¤Î¼èÆÀ
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.TH CLOCK 3 2008\-08\-28 GNU "Linux Programmer's Manual"
+.SH 名前
+clock \- プロセッサ時間の取得
+.SH 書式
 .nf
-.B #include <time.h>
+\fB#include <time.h>\fP
 .sp
-.B clock_t clock(void);
+\fBclock_t clock(void);\fP
 .fi
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O The
-.\"O .BR clock ()
-.\"O function returns an approximation of processor time used by the program.
-.BR clock ()
-¤Ï¥×¥í¥°¥é¥à¤Î»ÈÍѤ·¤¿¥×¥í¥»¥Ã¥µ»þ´Ö¤Î¶á»÷ÃͤòÊÖ¤¹¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O The value returned is the CPU time used so far as a
-.\"O .IR clock_t ;
-.\"O to get the number of seconds used, divide by
-.\"O .BR CLOCKS_PER_SEC .
-.\"O If the processor time used is not available or its value cannot
-.\"O be represented, the function returns the value
-.\"O .IR (clock_t)\ \-1 .
-ÊÖ¤êÃͤÏ
-.I clock_t
-ñ°Ì¤Ç¤Î CPU »þ´Ö¤Ç¤¢¤ë¡£
-ÉÃñ°Ì¤Ç¤ÎÃͤòÆÀ¤ë¤¿¤á¤Ë¤Ï
-.B CLOCKS_PER_SEC
-¤Ç³ä¤ì¤Ð¤è¤¤¡£
-»ÈÍѤ·¤¿¥×¥í¥»¥Ã¥µ»þ´Ö¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤ä¡¢¤½¤ÎÃͤòɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¡¢
-¤³¤Î´Ø¿ô¤Ï
-.I (clock_t)\ \-1
-¤òÊÖ¤¹¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O C89, C99, POSIX.1-2001.
-.\"O POSIX requires that
-.\"O .B CLOCKS_PER_SEC
-.\"O  equals 1000000 independent
-.\"O of the actual resolution.
-C89, C99, POSIX.1-2001.
-POSIX ¤Ï¼ÂºÝ¤ÎÀºÅ٤ˤϤè¤é¤º
-.B CLOCKS_PER_SEC
-¤¬ 1000000 ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O The C standard allows for arbitrary values at the start of the program;
-.\"O subtract the value returned from a call to
-.\"O .BR clock ()
-.\"O at the start of the program to get maximum portability.
-C ¤Îɸ½àµ¬³Ê¤Ç¤Ï¥×¥í¥°¥é¥à¤Î³«»Ï¤Î»þÅÀ¤Ç¤Ï¤É¤ó¤ÊÃͤ¬Ê֤äƤ­¤Æ¤â
-¤«¤Þ¤ï¤Ê¤¤¡£
-°Ü¿¢À­¤òºÇÂç¸Â³ÎÊݤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤Î³«»Ï»þ¤Ë
-.BR clock ()
-¤ò¸Æ¤Ó½Ð¤·¤Æ¤½¤ÎÃͤòº¹¤·°ú¤¯¤³¤È¡£
+.SH 説明
+\fBclock\fP()  はプログラムの使用したプロセッサ時間の近似値を返す。
+.SH 返り値
+返り値は \fIclock_t\fP 単位での CPU 時間である。 秒単位での値を得るためには \fBCLOCKS_PER_SEC\fP で割ればよい。
+使用したプロセッサ時間が得られない場合や、その値を表現できない場合、 この関数は \fI(clock_t)\ \-1\fP を返す。
+.SH 準拠
+C89, C99, POSIX.1\-2001.  POSIX は実際の精度にはよらず \fBCLOCKS_PER_SEC\fP が 1000000
+であることを要求している。
+.SH 注意
+C の標準規格ではプログラムの開始の時点ではどんな値が返ってきても かまわない。 移植性を最大限確保するためには、プログラムの開始時に
+\fBclock\fP()  を呼び出してその値を差し引くこと。
 .PP
-.\"O Note that the time can wrap around.
-.\"O On a 32-bit system where
-.\"O .B CLOCKS_PER_SEC
-.\"O equals 1000000 this function will return the same
-.\"O value approximately every 72 minutes.
-»þ¹ï¤Ï·å¤¢¤Õ¤ì¤¹¤ë²ÄǽÀ­¤¬¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£
-.B CLOCKS_PER_SEC
-¤¬ 1000000 ¤Ç¤¢¤ë 32 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
-¤³¤Î´Ø¿ô¤ÏÌó 72 Ê¬Ëè¤ËƱ¤¸ÃͤòÊÖ¤¹¤³¤È¤Ë¤Ê¤ë¡£
+時刻は桁あふれする可能性がある点に注意すること。 \fBCLOCKS_PER_SEC\fP が 1000000 である 32 ビットシステムでは、
+この関数は約 72 分毎に同じ値を返すことになる。
 .PP
-.\"O On several other implementations,
-.\"O the value returned by
-.\"O .BR clock ()
-.\"O also includes the times of any children whose status has been
-.\"O collected via
-.\"O .BR wait (2)
-.\"O (or another wait-type call).
-¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢
-.BR clock ()
-¤ÇÊÖ¤µ¤ì¤ëÃͤË
-.BR wait (2)
-(¤¢¤ë¤¤¤Ï¤½¤Î¾¤Î wait ¤Î¤è¤¦¤Ê´Ø¿ô) ¤Ç¼ý½¸¤µ¤ì¤¿
-»Ò¥×¥í¥»¥¹¤Î»þ´Ö¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£
-.\"O Linux does not include the times of waited-for children in the
-.\"O value returned by
-.\"O .BR clock ().
-Linux ¤Ç¤Ï¡¢
-.BR clock ()
-¤¬ÊÖ¤¹ÃͤˤϠwait ¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Î»þ´Ö¤Ï´Þ¤Þ¤ì¤Ê¤¤¡£
 .\" I have seen this behavior on Irix 6.3, and the OSF/1, HP/UX, and
 .\" Solaris manual pages say that clock() also does this on those systems.
 .\" POSIX.1-2001 doesn't explicitly allow this, nor is there an
 .\" explicit prohibition. -- MTK
-.\"O The
-.\"O .BR times (2)
-.\"O function, which explicitly returns (separate) information about the
-.\"O caller and its children, may be preferable.
-.BR times (2)
-´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¸µ¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Ë´Ø¤¹¤ë¾ðÊó¤ò
-(ÊÌ¡¹¤Ë) ÌÀ¼¨Åª¤ËÊÖ¤¹¤Î¤Ç¡¢¤è¤ê¹¥¤Þ¤·¤¤¤À¤í¤¦¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR clock_gettime (2),
-.BR getrusage (2),
-.BR times (2)
+実装によっては、 \fBclock\fP()  で返される値に \fBwait\fP(2)  (あるいはその他の wait のような関数) で収集された
+子プロセスの時間が含まれる場合もある。 Linux では、 \fBclock\fP()  が返す値には wait された子プロセスの時間は含まれない。
+\fBtimes\fP(2)  関数は呼び出し元とその子プロセスに関する情報を (別々に) 明示的に返すので、より好ましいだろう。
+.SH 関連項目
+\fBclock_gettime\fP(2), \fBgetrusage\fP(2), \fBtimes\fP(2)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。