mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-27 15:58:10 -05:00
6 lines
191 B
Python
6 lines
191 B
Python
import time
|
|
|
|
class Timing(object):
|
|
def __enter__(self): self.st = time.monotonic_ns()
|
|
def __exit__(self, exc_type, exc_val, exc_tb): print(f"{(time.monotonic_ns()-self.st)*1e-6:.2f} ms")
|