[Tutor] The time and clock functions

Alan Gauld alan.gauld@blueyonder.co.uk
Sat Jun 21 12:36:02 2003


> When I am in IDLE,  I can't get the time() or clock() functions to
work.
> Can someone provide a code snippet I can use???  I thought they were
> built-in and didn't require anything more than just invoking them.

Try importing time first.

>From an IDLE session:

>>> import time
>>> time.time()
1056213217.603
>>> time.clock()
20.344167205608535
>>>