cpython/Lib/test/test_timing.py

22 lines
354 B
Python
Raw Normal View History

from test_support import verbose
1997-01-13 19:03:07 -04:00
import timing
r = range(100000)
if verbose:
print 'starting...'
timing.start()
for i in r:
pass
timing.finish()
if verbose:
print 'finished'
secs = timing.seconds()
milli = timing.milli()
micro = timing.micro()
if verbose:
print 'seconds:', secs
print 'milli :', milli
print 'micro :', micro