MCPcopy Index your code
hub / github.com/python/cpython / collect_time

Function collect_time

Lib/test/pythoninfo.py:464–488  ·  view source on GitHub ↗
(info_add)

Source from the content-addressed store, hash-verified

462
463
464def collect_time(info_add):
465 import time
466
467 info_add('time.time', time.time())
468
469 attributes = (
470 'altzone',
471 'daylight',
472 'timezone',
473 'tzname',
474 )
475 copy_attributes(info_add, time, 'time.%s', attributes)
476
477 if hasattr(time, 'get_clock_info'):
478 for clock in ('clock', 'monotonic', 'perf_counter',
479 'process_time', 'thread_time', 'time'):
480 try:
481 # prevent DeprecatingWarning on get_clock_info('clock')
482 with warnings.catch_warnings(record=True):
483 clock_info = time.get_clock_info(clock)
484 except ValueError:
485 # missing clock like time.thread_time()
486 pass
487 else:
488 info_add('time.get_clock_info(%s)' % clock, clock_info)
489
490
491def collect_curses(info_add):

Callers

nothing calls this directly

Calls 2

copy_attributesFunction · 0.85
timeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…