import time
available_clocks = [
('clock', time.perf_counter()),
('monotonic', time.monotonic),
('perf_counter', time.perf_counter),
('process_time', time.process_time),
('time', time.time)
]
for clock_name, func in available_clocks:
print(textwrap.dedent('''\
{name}:
adjustable : {info.adjustable}
implementation : {info.implementation}
monotonic : {info.monotonic}
resolution :{info.resolution}
current : {current}
''').format(
name=clock_name,
info=time.get_clock_info(clock_name),
current=func())
)
Traceback (most recent call last):
File "F:\pathon\LZY\study_time\study.time.py", line 21, in <module>
info=time.get_clock_info(clock_name),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: unknown clock