Python Exercise Example 92
Question:Time function example 2.
Program 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 ……Other Extensions
Python 100 Examples