MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / cpu_timeit

Method cpu_timeit

Utility/Timer.py:25–39  ·  view source on GitHub ↗
(cls, name: str)

Source from the content-addressed store, hash-verified

23
24 @classmethod
25 def cpu_timeit(cls, name: str):
26 def decorator(func):
27 @wraps(func)
28 def wrapped(*args, **kwargs):
29 if not cls.ACTIVE: return func(*args, **kwargs)
30 time_stream = cls.CPU_TIME_STREAM.get(name, ([], []))
31
32 time_stream[0].append(time.time() * 1000)
33 result = func(*args, **kwargs)
34 time_stream[1].append(time.time() * 1000)
35
36 cls.CPU_TIME_STREAM[name] = time_stream
37 return result
38 return wrapped
39 return decorator
40
41 @classmethod
42 def gpu_timeit(cls, name: str):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected