for i:=1;i<=Max;i++{
returnVal.Channl <- true
}
- time.Sleep(time.Duration(Second)*time.Second)
+ time.Sleep(time.Duration(Second)*time.Millisecond)
}
}(&returnVal)
if l.Stop {return false}
select {
case <-l.Channl :;
- case <-time.After(time.Duration(l.TimeOut)*time.Second):return true;
+ case <-time.After(time.Duration(l.TimeOut)*time.Millisecond):return true;
}
return false
}
\ No newline at end of file
return Ppart.PProxy(s,pac);
}
-func GetCpuPercent() (float64,error) {
+func (this *sys) GetCpuPercent() (float64,error) {
if a,e := gopsutilLoad.Avg();e == nil{
if i,e:=gopsutilCpu.Counts(true);e == nil{
return (*a).Load1/float64(i),nil