Created
May 24, 2018 03:03
-
-
Save nirui/82608ab20e5aac3bd3c1eb5a8f78d23c 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
package main | |
import ( | |
"testing" | |
"time" | |
) | |
func BenchmarkTimeNow(b *testing.B) { | |
for i := 0; i < b.N; i++ { | |
time.Now() | |
} | |
} | |
// goos: linux | |
// goarch: amd64 | |
// BenchmarkTimeNow-2 500000 3758 ns/op |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also tested on Go 1.10.2 tarball downloaded directly from Golang website. It still slow but the profile information is differ.