File size: 452 Bytes
13c2bf6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package unix_test

import (
	"internal/syscall/unix"
	"testing"
)

func BenchmarkParallelGetRandom(b *testing.B) {
	b.SetBytes(4)
	b.RunParallel(func(pb *testing.PB) {
		var buf [4]byte
		for pb.Next() {
			if _, err := unix.GetRandom(buf[:], 0); err != nil {
				b.Fatal(err)
			}
		}
	})
}