58. timer — A timer class.

A timer class.

Classes defined in module timer

class timer.Timer

A class for measuring elapsed time.

Methods

reset()

Start the timer.

read()

Read the timer.

This returns the elapsed time since the last reset (or the creation of the timer) as a datetime.timedelta object.

seconds(rounded=True)

Return the timer readings in seconds.

The default return value is a rounded integer number of seconds. With rounded == False, a floating point value with granularity of 1 microsecond is returned.

Functions defined in module timer

Documentation

Previous topic

57. sendmail — sendmail.py: a simple program to send an email message

Next topic

59. misc — Python equivalents of the functions in lib.misc

This Page