use 10microsend duration for CPUPercent test.

This commit is contained in:
Shirou WAKAYAMA 2014-11-12 11:17:55 +09:00
parent 6adc13e592
commit 5169be59e4
1 changed files with 3 additions and 2 deletions

View File

@ -67,8 +67,9 @@ func testCPUPercent(t *testing.T, percpu bool) {
if (percpu && len(v) != numcpu) || (!percpu && len(v) != 1) {
t.Fatalf("wrong number of entries from CPUPercent: %v", v)
}
for i := 0; i < 1000; i++ {
v, err := CPUPercent(0, percpu)
for i := 0; i < 100; i++ {
duration := time.Duration(10) * time.Microsecond
v, err := CPUPercent(duration, percpu)
if err != nil {
t.Errorf("error %v", err)
}