We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25c5dd4 commit fbb1767Copy full SHA for fbb1767
2 files changed
code/go/generic_bench_test.go
@@ -0,0 +1,25 @@
1
+package main
2
+
3
+import (
4
+ "sync/atomic"
5
+ "testing"
6
+)
7
8
+func Benchmark_atomicBoolLoad(b *testing.B) {
9
10
+ var atomicB atomic.Bool
11
+ atomicB.Store(true)
12
13
+ for b.Loop() {
14
+ _ = atomicB.Load()
15
+ }
16
+}
17
18
+func Benchmark_nonAtomicBoolLoad(b *testing.B) {
19
20
+ var nonAtmicB bool = true
21
22
23
+ _ = nonAtmicB
24
25
code/go/go.mod
@@ -0,0 +1,3 @@
+module github.com/jrasell/dev-mess
+go 1.25.4
0 commit comments