diff --git a/process/process_test.go b/process/process_test.go index e18a26d..28518b8 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -662,3 +662,24 @@ func Test_AllProcesses_cmdLine(t *testing.T) { } } } + +func BenchmarkNewProcess(b *testing.B) { + checkPid := os.Getpid() + for i := 0; i < b.N; i++ { + NewProcess(int32(checkPid)) + } +} + +func BenchmarkProcessName(b *testing.B) { + p := testGetProcess() + for i := 0; i < b.N; i++ { + p.Name() + } +} + +func BenchmarkProcessPpid(b *testing.B) { + p := testGetProcess() + for i := 0; i < b.N; i++ { + p.Ppid() + } +}