hendrik/scripts/ntro.py

13 lines
297 B
Python

import time
def start():
return {"_start": time.perf_counter_ns()}
def end(stamp):
elapsed_ns = time.perf_counter_ns() - stamp["_start"]
elapsed_ms = elapsed_ns / 1_000_000
print(f"[ntropy] {elapsed_ms:.2f}ms")
stamp["_start"] = time.perf_counter_ns()
return elapsed_ms