Lecture 21: Timing Programs and Counting Operations
At a glance
- Price Free to watch, no sign-up
- Runtime 32 min
- Topics Computer Science, Mathematics
- Source MIT, Introduction to CS and Programming using Python
- Lecture Lecture 21 of 25
- Language English
Ana Bell teaches this lecture from MIT's 6.100L, Introduction to CS and Programming using Python, on how to evaluate the efficiency of a program. She covers using a timer to measure actual running time, why wall-clock timing is unreliable for comparing algorithms, and the alternative approach of counting the number of basic operations a program performs as its input grows. The lecture builds toward abstracting these operation counts into order of growth, laying groundwork for later discussion of big-O notation. Bell works through code examples on the board and screen, showing how different implementations of the same task scale differently as input size increases. The session is part of the Fall 2022 offering of 6.100L and assumes familiarity with basic Python programming from earlier lectures in the course.