OSDN Git Service

(split) LDP: Update releases based on LDP 3.52 release
[linuxjm/LDP_man-pages.git] / release / man3 / clock.3
index 076cb7f..cbd8fcc 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
 .\"    waited-for children.
+.\"*******************************************************************
 .\"
-.\" Japanese Version Copyright (c) 1996 Hiroaki Nagoya
-.\"         all rights reserved.
-.\" Tranlated 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»þ´Ö
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.TH CLOCK 3  2008-08-28 "GNU" "Linux Programmer's Manual"
-.SH Ì¾Á°
-clock \- ¥×¥í¥»¥Ã¥µ»þ´Ö¤Î¼èÆÀ
-.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
-.SH ÀâÌÀ
-.BR clock ()
-¤Ï¥×¥í¥°¥é¥à¤Î»ÈÍѤ·¤¿¥×¥í¥»¥Ã¥µ»þ´Ö¤Î¶á»÷ÃͤòÊÖ¤¹¡£
-.SH ÊÖ¤êÃÍ
-ÊÖ¤êÃͤÏ
-.I clock_t
-ñ°Ì¤Ç¤Î CPU »þ´Ö¤Ç¤¢¤ë¡£
-ÉÃñ°Ì¤Ç¤ÎÃͤòÆÀ¤ë¤¿¤á¤Ë¤Ï
-.B CLOCKS_PER_SEC
-¤Ç³ä¤ì¤Ð¤è¤¤¡£
-»ÈÍѤ·¤¿¥×¥í¥»¥Ã¥µ»þ´Ö¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤ä¡¢¤½¤ÎÃͤòɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¡¢
-¤³¤Î´Ø¿ô¤Ï
-.I (clock_t)\ \-1
-¤òÊÖ¤¹¡£
-.SH ½àµò
-C89, C99, POSIX.1-2001.
-POSIX ¤Ï¼ÂºÝ¤ÎÀºÅ٤ˤϤè¤é¤º
-.B CLOCKS_PER_SEC
-¤¬ 1000000 ¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¡£
-.SH Ãí°Õ
-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
-»þ¹ï¤Ï·å¤¢¤Õ¤ì¤¹¤ë²ÄǽÀ­¤¬¤¢¤ëÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£
-.B CLOCKS_PER_SEC
-¤¬ 1000000 ¤Ç¤¢¤ë 32 ¥Ó¥Ã¥È¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
-¤³¤Î´Ø¿ô¤ÏÌó 72 Ê¬Ëè¤ËƱ¤¸ÃͤòÊÖ¤¹¤³¤È¤Ë¤Ê¤ë¡£
+時刻は桁あふれする可能性がある点に注意すること。 \fBCLOCKS_PER_SEC\fP が 1000000 である 32 ビットシステムでは、
+この関数は約 72 分毎に同じ値を返すことになる。
 .PP
-¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢
-.BR clock ()
-¤ÇÊÖ¤µ¤ì¤ëÃͤË
-.BR wait (2)
-(¤¢¤ë¤¤¤Ï¤½¤Î¾¤Î wait ¤Î¤è¤¦¤Ê´Ø¿ô) ¤Ç¼ý½¸¤µ¤ì¤¿
-»Ò¥×¥í¥»¥¹¤Î»þ´Ö¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤â¤¢¤ë¡£
-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
-.BR times (2)
-´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·¸µ¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Ë´Ø¤¹¤ë¾ðÊó¤ò
-(ÊÌ¡¹¤Ë) ÌÀ¼¨Åª¤ËÊÖ¤¹¤Î¤Ç¡¢¤è¤ê¹¥¤Þ¤·¤¤¤À¤í¤¦¡£
-.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.52 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。