mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Test of the timing module
This commit is contained in:
parent
58d40a7400
commit
a6aca46fcb
1 changed files with 21 additions and 0 deletions
21
Lib/test/test_timing.py
Normal file
21
Lib/test/test_timing.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from test_support import verbose
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue