Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Don't record generation time on fingerprint bench
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> <github: jlhawn)
  • Loading branch information
Josh Hawn committed Nov 24, 2014
1 parent 781dde4 commit ac2e85a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions key_test.go
Expand Up @@ -16,10 +16,14 @@ func runGenerateBench(b *testing.B, f generateFunc, name string) {
}

func runFingerprintBench(b *testing.B, f generateFunc, name string) {
b.StopTimer()
// Don't count this relatively slow generation call.
key, err := f()
if err != nil {
b.Fatalf("Error generating %s: %s", name, err)
}
b.StartTimer()

for i := 0; i < b.N; i++ {
if key.KeyID() == "" {
b.Fatalf("Error generating key ID for %s", name)
Expand Down

0 comments on commit ac2e85a

Please sign in to comment.