FLYNNLABAboutMeCodingActivityStudy 2024초등수학
time estimate in python
python

python에서 로거를 만든다거나 할때 코드의 시간을 측정하고 싶을때가 있다. 이때 python에서 기본으로 제공하는 time 모듈을 사용해보자

perf_counter

t0 = time.perf_counter()
recolorize_main()
t1 = time.perf_counter()
print("%.3f seconds" % (t1-t0))

process_time

t0 = time.process_time()
recolorize_main()
t1 = time.process_time()
print("%.3f seconds" % (t1-t0))