(cls, name: str)
| 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): |
nothing calls this directly
no outgoing calls
no test coverage detected