mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
- Note: process_time gives CPU time used and perf_counter is absolute time used. - Looks to have noise of about 1-2%.
20 lines
297 B
Python
20 lines
297 B
Python
from __future__ import print_function
|
|
|
|
import time
|
|
|
|
start = time.process_time()
|
|
|
|
map = {}
|
|
|
|
for i in range(1, 2000001):
|
|
map[i] = i
|
|
|
|
sum = 0
|
|
for i in range(1, 2000001):
|
|
sum = sum + map[i]
|
|
print(sum)
|
|
|
|
for i in range(1, 2000001):
|
|
del map[i]
|
|
|
|
print("elapsed: " + str(time.process_time() - start)) |