最終更新:2024-08-19 (月) 20:49:54 (317d)
Python/time.get_clock_info
https://docs.python.org/ja/3/library/time.html?highlight=time time#time.get_clock_info
import time print(time.get_clock_info('monotonic')) print(time.get_clock_info('perf_counter')) print(time.get_clock_info('process_time')) print(time.get_clock_info('thread_time')) print(time.get_clock_info('time'))
return
implementation
monotonic
- クロック値が後戻りすることがない場合 True が、そうでない場合は False
- 外部要因などで減算されない場合にTrue
adjustable
- 自動 (NTP デーモンによるなど) またはシステム管理者による手動で変更できる場合は True、それ以外の場合は False
resolution
Windows
- 3.12.5
namespace(implementation='GetTickCount64()', monotonic=True, adjustable=False, resolution=0.015625) namespace(implementation='QueryPerformanceCounter()', monotonic=True, adjustable=False, resolution=1e-07) namespace(implementation='GetProcessTimes()', monotonic=True, adjustable=False, resolution=1e-07) namespace(implementation='GetThreadTimes()', monotonic=True, adjustable=False, resolution=1e-07) namespace(implementation='GetSystemTimeAsFileTime()', monotonic=False, adjustable=True, resolution=0.015625)
Python 3.8.2 (Windows) monotonic Python/time.monotonic?() namespace(adjustable=False, implementation='GetTickCount64()', monotonic=True, resolution=0.015625) perf_counter Python/time.perf_counter() namespace(adjustable=False, implementation='QueryPerformanceCounter()', monotonic=True, resolution=1e-07) process_time Python/time.process_time() namespace(adjustable=False, implementation='GetProcessTimes()', monotonic=True, resolution=1e-07) thread_time Python/time.thread_time?() namespace(adjustable=False, implementation='GetThreadTimes?()', monotonic=True, resolution=1e-07) time Python/time.time() namespace(adjustable=True, implementation='GetSystemTimeAsFileTime()', monotonic=False, resolution=0.015625)
Ubuntu
Python 3.6.9? (Ubuntu 18.04) monotonic Python/time.monotonic?() namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09) perf_counter Python/time.perf_counter() namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09) process_time Python/time.process_time() namespace(adjustable=False, implementation='clock_gettime(CLOCK_PROCESS_CPUTIME_ID?)', monotonic=True, resolution=1e-09) thread_time Python/time.thread_time?() unknown clock time Python/time.time() namespace(adjustable=True, implementation='clock_gettime(CLOCK_REALTIME)', monotonic=False, resolution=1e-09)