1. Home
  2. Data Science
  3. Python
  4. What does timeit do in Python?

Added 25 Nov 2026

What does timeit do in Python?

  1. Schedules tasks
  2. Sleeps
  3. Measures the execution time of small code snippets Correct answer
  4. Formats time

Correct answer

C. Measures the execution time of small code snippets

MCQSEXAM

Explanation

timeit runs code many times for reliable timings.

Reference

Asked in: Python Interview Advanced

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs