-
-
Save coffeepots/bc4463afc420f51b975a0efad5bb313a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tables, times | |
var | |
table = initTable[int, int]() | |
t1, t2: float | |
const loops = 10_000 | |
t1 = cpuTime() | |
for i in 0..<loops: | |
table.add(i, i) | |
echo "add ", cpuTime() - t1 # displays 0.002 | |
t1 = cpuTime() | |
for i in 0..<loops: | |
table.del(i) | |
echo "del ", cpuTime() - t1 # displays 1.313 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment