1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
.\" Copyright (c) 2006 by Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\" 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.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" 2008-06-24, mtk: added some details about where jiffies come into
.\" play; added section on high-resolution timers.
.\"
.\" Japanese Version Copyright (c) 2006 Yuichi SATO
.\" all rights reserved.
.\" Translated 2006-07-23 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.36
.\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.44
.\" Updated 2008-08-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
.\"
.TH TIME 7 2009-02-10 "Linux" "Linux Programmer's Manual"
.SH ̾
time \- ֤ȥޤγ
.SH
.SS "» (real time) ȥץ"
\fI»\fRϡλפä֤롣
λȤϡɸŪʻ
(ε (Epoch) ȥ) 䡢
ץΰˤ벿餫λ (㤨Сϻ) Ǥ
.RI ( "в" )
\fIץ\fRϡץˤäƻȤ줿 CPU ֤롣
¿ξ硢\fI桼\fR֤\fIƥ\fR֤ʬ롣
桼 CPU ֤ϡɤ桼⡼ɤǼ¹ԤΤ˻Ȥä֤Ǥ롣
ƥ CPU ֤ϡΥץΤ
ͥ뤬ƥ⡼ɤǼ¹ԤΤ˻Ȥä֤Ǥ
(㤨Сƥॳ¹ԤΤ˻Ȥä)
.BR time (1)
ޥɤϥץμ¹Ԥ줿 CPU ֤פΤ˻Ѥ롣
ץϡȤ CPU ֤
.BR times (2),
.BR getrusage (2),
.BR clock (3)
ȤäƷפ뤳ȤǤ롣
.SS ϡɥå
¿Υԥ塼 (ӤǶư) ϡɥåäƤ롣
ͥϵư˥եȥå뤿
ϡɥåɤ߹ࡣ
ܤϡ
.BR rtc (4)
.BR hwclock (8)
Ȥ뤳ȡ
.SS "եȥå, HZ, Jiffy"
ॢȤꤷ (㤨
.BR select (2),
.BR sigtimedwait (2))
.\" semtimedop(), mq_timedwait(), io_getevents(), poll() Ʊ futex Ǥꡢ
.\" ää sem_timedwait() Ϲ٥ޤѤƤ褦Ǥ롣
CPU ֤¬ (㤨
.BR getrusage (2)) ͡ʥƥॳ٤
.I եȥå
ʬǽ (resolution) ¤롣
եȥåȤϡͥ뤬
.I jiffy
ñ̤ǻ֤¬륯åΤȤǤ롣
jiffy 礭ϥͥ
.I HZ
ͤǷꤵ롣
.I HZ
ͤϥͥΥСȥϡɥץåȥեǰۤʤ롣
i386 ξϰʲ̤Ǥ:
2.4.x ȤΥͥǤϡHZ 100 ǤäΤǡ
jiffy ͤ 0.01 äˤʤäƤ
2.6.0 ʹߤǤϡHZ 1000 䤵줿Τǡjiffy ͤ 0.001 äǤ롣
ͥ 2.6.13 ʹߤǤϡHZ ͤϥͥѥˤʤꡢ
100, 250 (ǥե), 1000 ȤͤˤǤ롣
줾 jiffy ͤ 0.01, 0.004, 0.001 äˤʤ롣
ͥ 2.6.20 ʹߤǤϡ300 ѤǤ褦ˤʤäƤ롣
300 ϰŪʱե졼졼ȤθܿǤ (PAL, 25HZ; NTSC, 30HZ)
.BR times (2)
ƥॳüʥǤꡢ
Υƥॳϥͥ
.I USER_HZ
줿γ٤ǻ֤𤹤롣
桼֤Υץꥱ
.I sysconf(_SC_CLK_TCK)
ȤäƤͤΤ뤳ȤǤ롣
.\" glibc gets this info with a little help from the ELF loader;
.\" see glibc elf/dl-support.c and kernel fs/binfmt_elf.c.
.\"
.SS "٥"
Linux 2.6.21 Ǥϡޤ䥹״ϢΥƥॳ٤
jiffy Υˤ¤Ƥ
Linux 2.6.21 ʹߤǤϡLinux Ϲ٥ (high-resolution timers; HRTs)
ݡȤƤꡢ
.B CONFIG_HIGH_RES_TIMERS
Ǥ롣
٥ޤݡȤƤ륷ƥǤϡޤȥ״ϢΥƥॳ
٤ϤϤ jiffy 뤳ȤϤʤ
ϡɥ¤٤Ȥʤ
(ǶΥϡɥǤϥޥñ̤٤ŪǤ)
٥ޤݡȤƤ뤫ϡ
.BR clock_getres (2)
ƤӽФʬǽǧ뤫
.I /proc/timer_list
"resolution" ȥȤ뤫ȽǤǤ롣
٥ޤϤ٤ƤΥϡɥƥǥݡȤƤ
ǤϤʤ (бƤ륢ƥ x86, arm, powerpc Ǥ)
.SS ""
Unix ƥϻ \fI\fR ÿɽ롣
1970 ǯ 1 1 ī 0:00:00 UTC 롣
ץ \fI\fR
.BR gettimeofday (2)
ȤäƷפ뤳ȤǤ롣
δؿϵηв֤ (äȥޥä) ֤
.BR time (2)
Ʊͤξ뤬Ǥᤤä٤ʤ
ƥ
.BR settimeofday (2)
ѹǤ롣
.SS "̤λ"
饤֥ؿˤ
.I tm
ι¤ΤȤΤ롣
ι¤Τ\fI̤λ\fRɽ
̡ͤ (ǯʬäʤ) ʬƳǼ롣
ι¤Τ
.BR ctime (3)
˵ҤƤꡢ̤λѴ
ؿˤĤƤҤƤ롣
̤λɽǽʸѴؿˤĤƤϡ
.BR ctime (3),
.BR strftime (3),
.BR strptime (3)
˵ҤƤ롣
.SS "ޤΥפ"
͡ʥƥॳȴؿˤꡢꤵ줿λ֡
ץϥ (¹Ԥ) 뤳ȤǽǤ롣
.BR nanosleep (2),
.BR clock_nanosleep (2),
.BR sleep (3)
Ȥ뤳ȡ
͡ʥƥॳˤꡢץϾΤ
֤ͭλ륿ޤǤ롣
ޤץȤƷֳ֤֤ǤΤ⤢롣
.BR alarm (2),
.BR getitimer (2),
.BR timerfd_create (2),
.BR timer_create (2)
Ȥ뤳ȡ
.SH Ϣ
.BR date (1),
.BR time (1),
.BR adjtimex (2),
.BR alarm (2),
.BR clock_gettime (2),
.BR clock_nanosleep (2),
.BR getitimer (2),
.BR getrlimit (2),
.BR getrusage (2),
.BR gettimeofday (2),
.BR nanosleep (2),
.BR stat (2),
.BR time (2),
.BR timer_create (2),
.BR timerfd_create (2),
.BR times (2),
.BR utime (2),
.BR adjtime (3),
.BR clock (3),
.BR clock_getcpuclockid (3),
.BR ctime (3),
.BR pthread_getcpuclockid (3),
.BR sleep (3),
.BR strftime (3),
.BR strptime (3),
.BR timeradd (3),
.BR usleep (3),
.BR rtc (4),
.BR hwclock (8)
|