Skip to content

Commit

Permalink
proper benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Aug 27, 2023
1 parent 4ed0f14 commit 6fff1c0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions process/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,9 @@ func BenchmarkProcessPpid(b *testing.B) {
}

func BenchmarkProcesses(b *testing.B) {
ps, err := Processes()
require.NoError(b, err)
require.Greater(b, len(ps), 0)
for i := 0; i < b.N; i++ {
ps, err := Processes()
require.NoError(b, err)
require.Greater(b, len(ps), 0)
}
}

0 comments on commit 6fff1c0

Please sign in to comment.