mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
10 lines
225 B
Python
10 lines
225 B
Python
import time
|
|
|
|
|
|
def accurate_sleepfunc(t) -> float:
|
|
"""T is in seconds"""
|
|
start_time = time.perf_counter_ns()
|
|
while True:
|
|
if (time.perf_counter_ns() - start_time) / 10e9 >= t:
|
|
break
|
|
return t
|