O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

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

hotshot

The hotshot module provides high-performance profiling information. Because the module is written primarily in C, it should be much faster than the profile module.

						Profile(filename
						[,
						lineevents
						[,
						linetimings]])

Creates a Profile object. filename is the name of a file to which profile data will be logged. lineevents is a Boolean flag that indicates whether to log each line of source code or just function calls. The default value is False. linetimings is a Boolean flag that indicates whether or not to record timing information. The default value is True.

An instance, p, of Profile has the following methods:

						p.addinfo(key,value)

Adds a labeled value to the profile output.

						p.close()

Closes the profiler.

						p.fileno()

Returns the file number ...

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