Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python Exercise Example 92

Python Exercise Example 92

Python 100 Examples Python 100 Examples

**Problem:** Time function example 2.

**Analysis:** None.

Example (Python 2.0+)

#!/usr/bin/python

-- coding: UTF-8 --

if

name

==

'

main

'

:

import

time

start

=

time

.

time

(

)

for

i

in

range

(

3000

)

:

print

i

end

=

time

.

time

(

)

print

end

start

The output of the above example is:


0
1
2
3
4
……

Python 100 Examples Python 100 Examples