1
0
forked from Mirror/wren
Files
wren/test/benchmark/for.py
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00

20 lines
332 B
Python

from __future__ import print_function
import time
# Map "range" to an efficient range in both Python 2 and 3.
try:
range = xrange
except NameError:
pass
start = time.clock()
list = []
for i in range(0, 1000000):
list.append(i)
sum = 0
for i in list:
sum += i
print(sum)
print("elapsed: " + str(time.clock() - start))