最終更新:2024-08-19 (月) 20:49:54 (317d)  

Python/time.get_clock_info
Top / 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)

Ubuntu

関連