Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Jun 20, 2023
1 parent d6afa02 commit 0489ab7
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions profiler_test.go
Expand Up @@ -47,6 +47,7 @@ func (t *profilerTestTicker) Tick() bool {
}

func setupProfilerTestTicker(t *testing.T) *profilerTestTicker {

Check failure on line 49 in profiler_test.go

View workflow job for this annotation

GitHub Actions / Lint

unnecessary leading newline (whitespace)

Check failure on line 50 in profiler_test.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofmt`-ed with `-s` (gofmt)
ticker := &profilerTestTicker{
t: t,
tick: make(chan time.Time, 1),
Expand Down Expand Up @@ -540,18 +541,15 @@ func profilerBenchmark(t *testing.T, b *testing.B, withProfiling bool) {
}
b.ResetTimer()

const numRoutines = 1000
var wg sync.WaitGroup
wg.Add(b.N)
for i := 0; i < b.N; i++ {
var wg sync.WaitGroup
wg.Add(numRoutines)
for j := 0; j < numRoutines; j++ {
go func() {
_ = findPrimeNumber(30000)
wg.Done()
}()
}
wg.Wait()
go func() {
_ = findPrimeNumber(30000)
wg.Done()
}()
}
wg.Wait()

b.StopTimer()
if withProfiling {
Expand Down

0 comments on commit 0489ab7

Please sign in to comment.