Last active
August 6, 2021 11:39
-
-
Save percybolmer/49beb83f485322d2645441d8a8bc8714 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
// insertXPreallocIntSlice is used to add X amount of items into a []int | |
func insertXPreallocIntSlice(x int, b *testing.B) { | |
// Initalize a Slice and insert X amount of Items | |
testSlice := make([]int, x) | |
// reset timer | |
b.ResetTimer() | |
for i := 0; i < x; i++ { | |
testSlice[i] = i | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment