|
|
@ -7,7 +7,8 @@ import (
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const COORDINATOR_DELAY time.Duration = 100 * time.Millisecond
|
|
|
|
const COORDINATOR_DELAY_MAX time.Duration = 100 * time.Millisecond
|
|
|
|
|
|
|
|
const COORDINATOR_DELAY_STEP time.Duration = 10 * time.Millisecond
|
|
|
|
|
|
|
|
|
|
|
|
func initProcs() {
|
|
|
|
func initProcs() {
|
|
|
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
|
|
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
|
|
@ -151,8 +152,11 @@ func Run(options *Options) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if ticks > 3 && delay && reading {
|
|
|
|
if delay && reading {
|
|
|
|
time.Sleep(COORDINATOR_DELAY)
|
|
|
|
dur := DurWithin(
|
|
|
|
|
|
|
|
time.Duration(ticks)*COORDINATOR_DELAY_STEP,
|
|
|
|
|
|
|
|
0, COORDINATOR_DELAY_MAX)
|
|
|
|
|
|
|
|
time.Sleep(dur)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|