Skip to content

Instantly share code, notes, and snippets.

@GiorgioSgl
Created May 8, 2022 16:14
Show Gist options
  • Save GiorgioSgl/b9a32d1e319422982f638615fad9fb70 to your computer and use it in GitHub Desktop.
Save GiorgioSgl/b9a32d1e319422982f638615fad9fb70 to your computer and use it in GitHub Desktop.
import time
from statistics import mean
test_times = 100 # number of time will be tested
def debug_time(func):
times_list = []
for _ in range(test_times):
start_time = time.process_time()
func()
end_time = time.process_time()
times_list.append(end_time-start_time)
avg_time = mean(times_list)
return avg_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment