Files
sunnypilot/selfdrive/debug/internal/realtime_benchmark.py
George Hotz 2048a6e3d3 selfdrive/debug
old-commit-hash: f467642a1c
2020-01-17 11:23:21 -08:00

23 lines
378 B
Python
Executable File

#!/usr/bin/env python3
import time
from common.realtime import sec_since_boot, monotonic_time
if __name__ == "__main__":
N = 100000
t = time.time()
for _ in range(N):
monotonic_time()
dt = time.time() - t
print("Monotonic", dt)
t = time.time()
for _ in range(N):
sec_since_boot()
dt = time.time() - t
print("Boot", dt)