How can i compare two python files' execution time????? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 14

How can i compare two python files' execution time?????

3rd May 2020, 4:28 PM
Pavithra Kanmanirajah
Pavithra Kanmanirajah - avatar
6 Answers
+ 5
This is what I normally do:- import time start = time.perf_counter_ns() # put you code anywhere # between "start" and "end" # and do the same for the # other file and compare. end = time.perf_counter_ns() print(end-start)
3rd May 2020, 4:53 PM
rodwynnejones
rodwynnejones - avatar
+ 5
Thank u
7th May 2020, 6:01 AM
Pavithra Kanmanirajah
Pavithra Kanmanirajah - avatar
+ 4
https://docs.python.org/3.8/library/timeit.html
4th May 2020, 8:14 AM
Tibor Santa
Tibor Santa - avatar
+ 1
use multithreading in python
5th May 2020, 1:38 PM
Prashant Pal
Prashant Pal - avatar
+ 1
use concept of multithreading in python
6th May 2020, 6:37 PM
Mohammad Yahya Azhar
Mohammad Yahya Azhar - avatar
0
5th May 2020, 2:35 PM
Rap Scene
Rap Scene - avatar