Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

python-How to measure time elapsed?

Asked by Rutuja Mishra Apr 6, 2021 1.3K views 1 answer
Share

About this question

How python measure time elapsed by using the timeit module if I want to start counting time somewhere in my code and then get the passed time? I think I am using the module wrong.

import timeit

start = timeit.timeit()

print "hello"

end = timeit.timeit()

print end - start 

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.