MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestConcurrent

Function TestConcurrent

internal/utils/fs/stat_test.go:30–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestConcurrent(t *testing.T) {
31 var before = time.Now()
32 defer func() {
33 t.Log(time.Since(before).Seconds()*1000, "ms")
34 }()
35
36 var count = 10000
37 var wg = sync.WaitGroup{}
38 wg.Add(count)
39 for i := 0; i < count; i++ {
40 go func() {
41 defer wg.Done()
42
43 _, _ = fsutils.StatDevice("/usr/local")
44 }()
45 }
46 wg.Wait()
47}
48
49func BenchmarkStatDevice(b *testing.B) {
50 b.RunParallel(func(pb *testing.PB) {

Callers

nothing calls this directly

Calls 4

LogMethod · 0.80
DoneMethod · 0.80
AddMethod · 0.65
WaitMethod · 0.45

Tested by

no test coverage detected