annotate Lib/test/test_timing.py @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents 19d819b16b82
children c1a8deb15f0e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4950
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
1 from test_support import verbose
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
2 import timing
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
3
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
4 r = range(100000)
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
5 if verbose:
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
6 print 'starting...'
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
7 timing.start()
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
8 for i in r:
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
9 pass
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
10 timing.finish()
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
11 if verbose:
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
12 print 'finished'
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
13
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
14 secs = timing.seconds()
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
15 milli = timing.milli()
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
16 micro = timing.micro()
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
17
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
18 if verbose:
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
19 print 'seconds:', secs
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
20 print 'milli :', milli
19d819b16b82 Test of the timing module
Barry Warsaw <barry@python.org>
parents:
diff changeset
21 print 'micro :', micro