O'Reilly logo

Software Architecture with Python by Anand Balachandran Pillai

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Measuring performance

Now that we've had an overview of what performance complexity is and also of performance testing and measurement tools, let us take an actual look at the various ways of measuring performance complexity with Python.

One of the simplest time measurements can be done by using the time command of a POSIX/Linux system.

This is done by using the following command line:

$ time <command>

For example, here is a screenshot of the time it takes to fetch a very popular page from the web:

Measuring performance

Output of the time command on fetching a web page from the internet via wget

See that it shows three classes of time output, namely real, user, and sys ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required