Skip to content

Instantly share code, notes, and snippets.

@coffeepots
Last active June 1, 2017 08:46
Show Gist options
  • Save coffeepots/bc4463afc420f51b975a0efad5bb313a to your computer and use it in GitHub Desktop.
Save coffeepots/bc4463afc420f51b975a0efad5bb313a to your computer and use it in GitHub Desktop.
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