aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmarks/stdlib-value-store/stm.go
blob: a5d3a01c2d4dbc4c8a947a638bb96f17ff319046 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package stm

import (
	"flag"
	"fmt"
	"sync/atomic"
)



var nFlag = flag.Int(
	"n",
	1_000,
	"The number of iterations to execute",
)

func MainTest() {
	flag.Parse()
	n := *nFlag

	v := atomic.Value{}
	for i := 0; i < n; i++ {
		v.Store(fmt.Sprint(i))
	}
}