From 87c662da2d3ac489a036f0d0f3a92049eef7e60e Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 2 Aug 2020 04:41:51 +0800 Subject: [PATCH] 25 --- flate.go => Flate.go | 0 Limit.go | 4 ++-- Sys.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename flate.go => Flate.go (100%) 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 -- 2.39.2