How to get Python program execution time in microseconds and milliseconds?

Viewed 83

I have a python program with all logic implemeneted in main() function. i need to compute how much time in microseconds or milliseconds the code is taking to run as a whole.

I tried cProfile but its giving answers in 0

if __name__ == '__main__':
import cProfile
cProfile.run(main)
0 Answers
Related