<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> 
<dfn>単調増加時計</dfn>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">単調増加</anchor>する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">時計</anchor>です。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> 
理想的環境ではすべての<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">時計</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">単調増加</anchor>するはずですが、
現実には<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">時刻調整<title xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">時刻同期</title></anchor>の結果減少したり、
長時間同じ値に留まったりする可能性があります。
そもそも<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">地方時</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">夏時刻</anchor>や<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">標準時</anchor>改正、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">時間帯を超えた移動<title xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">時間帯の接続</title></anchor>の影響を受ける可能性があります。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">単調増加時計</anchor>はこうした<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">非連続の可能性<title xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">日時不連続性</title></anchor>を排除したものです。</p><section><h1>API</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <figure class="middle list"><ul><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">POSIX</anchor> <code>clock_gettime</code></li><li><code class="perl"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Time::HiRes</anchor>::<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">clock_gettime</anchor></code></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">現在高分解能時刻</anchor><ul><li><code>Performance.now</code></li></ul></li></ul></figure></p></section><section><h1>メモ</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite xml:lang="ja">カーネルにおけるタイマー事情 ~第2回 カーネル内の時刻/時間関連サブシステム~ | VA Linux Systems Japan株式会社</cite>
( (<time>2016-06-20 16:07:01 +09:00</time>))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.valinux.co.jp/technologylibrary/document/linuxkernel/timer0002/">http://www.valinux.co.jp/technologylibrary/document/linuxkernel/timer0002/</anchor-external></p><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <cite>Man page of CLOCK_GETRES</cite>
( (<time>2016-02-19 11:33:56 +09:00</time>))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://linuxjm.osdn.jp/html/LDP_man-pages/man2/clock_gettime.2.html">https://linuxjm.osdn.jp/html/LDP_man-pages/man2/clock_gettime.2.html</anchor-external></figcaption><blockquote><p>CLOCK_MONOTONIC</p><p>設定することができないクロックで、ある開始時点からの単調増加の時間で 表現されるクロック (開始時点がどの時点となるかは規定されていない)。 この時計は、システム時間の不連続な変化 (例えば、システム管理者がシステ ム時間を手動で変更した場合など) の影響を受けないが、 adjtime(3) や NTP が行う段階的な調整の影響を受ける。</p><p>CLOCK_MONOTONIC_COARSE (Linux 2.6.32 以降; Linux 特有)</p><p>高速だが精度が低い CLOCK_MONOTONIC。速度が非常に必要で、かつ高精度のタイムスタンプが不要な場合に使用するとよい。</p><p>CLOCK_MONOTONIC_RAW (Linux 2.6.28 以降; Linux 特有)</p><p>CLOCK_MONOTONIC と同様だが、NTP による調整や adjtime(3) が行う 段階的な調整の影響を受けない、ハードウェアによる生の時刻へのアクセス ができる。</p></blockquote></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <cite>linux - Starting point for CLOCK_MONOTONIC - Stack Overflow</cite>
( (<time>2016-06-20 16:11:04 +09:00</time>))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://stackoverflow.com/questions/14726401/starting-point-for-clock-monotonic">http://stackoverflow.com/questions/14726401/starting-point-for-clock-monotonic</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <cite>linux - Difference between CLOCK_REALTIME and CLOCK_MONOTONIC? - Stack Overflow</cite>
( (<time>2016-06-20 16:15:26 +09:00</time>))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://stackoverflow.com/questions/3523442/difference-between-clock-realtime-and-clock-monotonic">http://stackoverflow.com/questions/3523442/difference-between-clock-realtime-and-clock-monotonic</anchor-external></p></section></body></html>