From: qydysky Date: Sat, 1 Aug 2020 20:41:51 +0000 (+0800) Subject: 25 X-Git-Tag: v0.0.2~63 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=87c662da2d3ac489a036f0d0f3a92049eef7e60e;p=part%2F.git 25 --- diff --git a/flate.go b/Flate.go similarity index 100% rename from flate.go rename to Flate.go diff --git a/Limit.go b/Limit.go index 7970bfa..ae46d1e 100644 --- a/Limit.go +++ b/Limit.go @@ -29,7 +29,7 @@ func Limit(Max,Second,TimeOut int) (*Limitl) { for i:=1;i<=Max;i++{ returnVal.Channl <- true } - time.Sleep(time.Duration(Second)*time.Second) + time.Sleep(time.Duration(Second)*time.Millisecond) } }(&returnVal) @@ -40,7 +40,7 @@ func (l *Limitl) TO() bool { 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 diff --git a/Sys.go b/Sys.go index fb76af5..f53d6e7 100644 --- a/Sys.go +++ b/Sys.go @@ -119,7 +119,7 @@ func (this *sys) SetProxy(s,pac string) error { 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