Skip to content

Commit

Permalink
Benchmark for time.Now().
Browse files Browse the repository at this point in the history
  • Loading branch information
markkurossi committed Sep 1, 2023
1 parent ccd5fc7 commit 200a819
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion circuit/stream_garble_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2020-2022 Markku Rossi
// Copyright (c) 2020-2023 Markku Rossi
//
// All rights reserved.
//
Expand All @@ -8,6 +8,7 @@ package circuit

import (
"testing"
"time"

"github.com/markkurossi/mpc/ot"
)
Expand Down Expand Up @@ -344,3 +345,12 @@ func encode7var5(b []byte, v uint32) {
b[3] = byte(v >> 7)
b[4] = byte(v)
}

func BenchmarkTimeDuration(b *testing.B) {
var total time.Duration

for i := 0; i < b.N; i++ {
start := time.Now()
total += time.Now().Sub(start)
}
}

0 comments on commit 200a819

Please sign in to comment.