13 lines
323 B
Python
13 lines
323 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
|
|
stamp["start"] = time.perf_counter_ns() # For start with multi end
|
|
# print(f"[ntropy] {elapsed_ms:.2f}ms")
|
|
return elapsed_ms
|
|
|