Uploaded September 2026 | Updated December 2026, 2 days ago
Continue here β realpython.com/courses/python-timer-functions/?utm_source=youtube&utm_medium=description&utm_campaign=python-timer-functions&utm_content=QQggEofGdss
Download your free Python Cheat Sheet here: realpython.com/cheatsheet?utm_source=youtube&utm_medium=description&utm_campaign=cheatsheet&utm_content=QQggEofGdss
Free Python Skill Test with instant level + learning plan: realpython.com/skill-test?utm_source=youtube&utm_medium=description&utm_campaign=skill-test&utm_content=QQggEofGdss
Want to learn faster? Become a Python Expert with unlimited access to 5,000+ tutorials, videos, and exercises: realpython.com/start?utm_source=youtube&utm_medium=description&utm_campaign=start&utm_content=QQggEofGdss
Python's time module gives you four different ways to measure time β monotonic(), perf_counter(), process_time(), and time() β and they don't all agree with each other. One ignores your system clock. One ignores sleep() entirely. One can run backwards.
In six minutes, Mahdi Shadkam-Farrokhi walks through all four with live demos, including winding the system clock back an hour mid-measurement to show which functions notice and which don't. By the end you'll know which function belongs in a timeout, which belongs in a benchmark, which belongs in a profiler, and which belongs in a log line.
Then take it further: the full video course abstracts these functions into a reusable Timer class, extends it to handle multiple timers, turns it into a data class, and finally makes it work as a context manager.
π Links from the video:
Python Timer Functions (video course): realpython.com/courses/python-timer-functions/?utm_source=youtube&utm_medium=description&utm_campaign=python-timer-functions&utm_content=QQggEofGdss
Python Timer Functions: Three Ways to Monitor Your Code: realpython.com/python-timer/?utm_source=youtube&utm_medium=description&utm_campaign=python-timer&utm_content=QQggEofGdss
The time module reference: realpython.com/ref/stdlib/time/?utm_source=youtube&utm_medium=description&utm_campaign=time&utm_content=QQggEofGdss
00:00 A riddle about time
00:18 All you need is import time
00:55 Which timer function when?
01:05 The four functions
01:12 monotonic() and monotonic_ns()
02:02 Demo: monotonic ignores the system clock
02:29 perf_counter() for benchmarking
02:51 process_time() counts CPU time only
03:21 Demo: sleep() and input() cost no CPU time
03:53 time() and the epoch
04:36 Why time() is the one for logging
04:58 Demo: time() running backwards
05:10 Building a Timer class
05:15 What the full course covers
π Become a Python expert with real-world tutorials, on-demand courses, interactive quizzes, and 24/7 access to a community of experts at https://realpython.com?utm_source=youtube&utm_medium=description&utm_campaign=home&utm_content=QQggEofGdss
β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
π Start Here β realpython.com/start?utm_source=youtube&utm_medium=description&utm_campaign=start&utm_content=QQggEofGdss
πΊοΈ Guided Learning Paths β realpython.com/learning-paths/?utm_source=youtube&utm_medium=description&utm_campaign=learning-paths&utm_content=QQggEofGdss
π§ Real Python Podcast β realpython.com/podcast?utm_source=youtube&utm_medium=description&utm_campaign=podcast&utm_content=QQggEofGdss
π Python Books β realpython.com/books?utm_source=youtube&utm_medium=description&utm_campaign=books&utm_content=QQggEofGdss
π Python Reference β realpython.com/ref?utm_source=youtube&utm_medium=description&utm_campaign=ref&utm_content=QQggEofGdss
π§βπ» Quizzes & Exercises β realpython.com/quizzes/?utm_source=youtube&utm_medium=description&utm_campaign=quizzes&utm_content=QQggEofGdss
π Live Courses: realpython.com/live/?utm_source=youtube&utm_medium=description&utm_campaign=live&utm_content=QQggEofGdss
βοΈ Reviews & Learner Stories: realpython.com/learner-stories/?utm_source=youtube&utm_medium=description&utm_campaign=learner-stories&utm_content=QQggEofGdss
β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
Continue here β realpython.com/courses/python-timer-functions/?utm_source=youtube&utm_medium=description&utm_campaign=python-timer-functions&utm_content=QQggEofGdss
Download your free Python Cheat Sheet here: realpython.com/cheatsheet?utm_source=youtube&utm_medium=description&utm_campaign=cheatsheet&utm_content=QQggEofGdss
Free Python Skill Test with instant level + learning plan: realpython.com/skill-test?utm_source=youtube&utm_medium=description&utm_campaign=skill-test&utm_content=QQggEofGdss
Want to learn faster? Become a Python Expert with unlimited access to 5,000+ tutorials, videos, and exercises: realpython.com/start?utm_source=youtube&utm_medium=description&utm_campaign=start&utm_content=QQggEofGdss
Python's time module gives you four different ways to measure time β monotonic(), perf_counter(), process_time(), and time() β and they don't all agree with each other. One ignores your system clock. One ignores sleep() entirely. One can run backwards.
In six minutes, Mahdi Shadkam-Farrokhi walks through all four with live demos, including winding the system clock back an hour mid-measurement to show which functions notice and which don't. By the end you'll know which function belongs in a timeout, which belongs in a benchmark, which belongs in a profiler, and which belongs in a log line.
Then take it further: the full video course abstracts these functions into a reusable Timer class, extends it to handle multiple timers, turns it into a data class, and finally makes it work as a context manager.
π Links from the video:
Python Timer Functions (video course): realpython.com/courses/python-timer-functions/?utm_source=youtube&utm_medium=description&utm_campaign=python-timer-functions&utm_content=QQggEofGdss
Python Timer Functions: Three Ways to Monitor Your Code: realpython.com/python-timer/?utm_source=youtube&utm_medium=description&utm_campaign=python-timer&utm_content=QQggEofGdss
The time module reference: realpython.com/ref/stdlib/time/?utm_source=youtube&utm_medium=description&utm_campaign=time&utm_content=QQggEofGdss
00:00 A riddle about time
00:18 All you need is import time
00:55 Which timer function when?
01:05 The four functions
01:12 monotonic() and monotonic_ns()
02:02 Demo: monotonic ignores the system clock
02:29 perf_counter() for benchmarking
02:51 process_time() counts CPU time only
03:21 Demo: sleep() and input() cost no CPU time
03:53 time() and the epoch
04:36 Why time() is the one for logging
04:58 Demo: time() running backwards
05:10 Building a Timer class
05:15 What the full course covers
π Become a Python expert with real-world tutorials, on-demand courses, interactive quizzes, and 24/7 access to a community of experts at https://realpython.com?utm_source=youtube&utm_medium=description&utm_campaign=home&utm_content=QQggEofGdss
β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
π Start Here β realpython.com/start?utm_source=youtube&utm_medium=description&utm_campaign=start&utm_content=QQggEofGdss
πΊοΈ Guided Learning Paths β realpython.com/learning-paths/?utm_source=youtube&utm_medium=description&utm_campaign=learning-paths&utm_content=QQggEofGdss
π§ Real Python Podcast β realpython.com/podcast?utm_source=youtube&utm_medium=description&utm_campaign=podcast&utm_content=QQggEofGdss
π Python Books β realpython.com/books?utm_source=youtube&utm_medium=description&utm_campaign=books&utm_content=QQggEofGdss
π Python Reference β realpython.com/ref?utm_source=youtube&utm_medium=description&utm_campaign=ref&utm_content=QQggEofGdss
π§βπ» Quizzes & Exercises β realpython.com/quizzes/?utm_source=youtube&utm_medium=description&utm_campaign=quizzes&utm_content=QQggEofGdss
π Live Courses: realpython.com/live/?utm_source=youtube&utm_medium=description&utm_campaign=live&utm_content=QQggEofGdss
βοΈ Reviews & Learner Stories: realpython.com/learner-stories/?utm_source=youtube&utm_medium=description&utm_campaign=learner-stories&utm_content=QQggEofGdss
β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°

.
Topics:
- 00:00:00 Introduction
- 00:02:46 Python 3.15.0 candidate 2 is here!
- 00:03:10 Django 6.1.1 release notes
- 00:03:20 Wagtail 8.0 release notes
- 00:04:27 RISC-V Is Now Officially Supported by CPython
- 00:05:19 PEP 843: Export Statement for DRY Re-Exports
- 00:06:27 2026 PSF Board Election Interviews
- 00:07:07 Up and Running with Rust Course
- 00:07:56 Guido Comment on PEP 805: Safe Parallel Python
- 00:09:56 The Polars vs SQL Differences Nobody Is Talking About
- 00:16:55 Sponsor: Six Feet Up
- 00:17:50 Unsubscribe Links Without a Login: Django Signing
- 00:20:56 Whats Missing to Have Reproducible Builds on PyPI
- 00:27:09 Video Course Spotlight
- 00:28:44 The Python Communitys Institutional Response to the Astral Acquisition Has Begun
- 00:29:57 The State of Django 2026: Boring Is So Back
- 00:40:13 matchify: Converts `if-else` Code to `match` Statements
- 00:43:14 pydantic-pint: Pydantic Pint Quantities
- 00:45:16 Thanks and goodbye - Submit topics to PyCoders Link
π Links from the show: https://realpython.com/podcasts/rpp/311/
Download your free Python Cheat Sheet here: https://realpython.com/cheatsheet
Free Python Skill Test with instant level + learning plan: https://realpython.com/skill-test
Want to learn faster? Become a Python Expert with unlimited access to 5,000+ tutorials, videos, and exercises: https://realpython.com/start
π Become a Python expert with real-world tutorials, on-demand courses, interactive quizzes, and 24/7 access to a community of experts at https://realpython.com
β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
π Start Here β https://realpython.com/start
πΊοΈ Guided Learning Paths β https://realpython.com/learning-paths
π§ Real Python Podcast β https://realpython.com/podcast
π Python Books β https://realpython.com/books
π Python Reference β https://realpython.com/ref
π§βπ» Quizzes & Exercises β https://realpython.com/quizzes
π Live Courses: https://realpython.com/live
βοΈ Reviews & Learner Stories: https://realpython.com/learner-stories
β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β° Django Developers Survey Results & Reproducible Python Builds | Real Python Podcast #311](https://i.ytimg.com/vi/R6vAEsBXPtM/mqdefault.jpg)








