Writing Decorator Functions to Time Your Python Code

Liu Zuo Lin
4 min readNov 6, 2021

Sometimes we have to write code that takes a while to run, be it a web-scraping task, a data preprocessing task or whatnot. In these cases, we probably want to use some sort of timer function to check how long our blocks of code takes to run.

The Simplest Way To Time Your Code

--

--