Last active
August 6, 2021 11:39
-
-
Save percybolmer/b378b3023eb3146edb19781bc510c7ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// insertXIntMap is used to add X amount of items into a Map[int]int | |
func insertXIntMap(x int, b *testing.B) { | |
// Initialize Map and Insert X amount of items | |
testmap := make(map[int]int, 0) | |
// Reset timer after Initalizing map, that's not what we want to test | |
b.ResetTimer() | |
for i := 0; i < x; i++ { | |
// Insert value of I into I key. | |
testmap[i] = i | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment