From 8c9d1b7dec123c1f192d27e9b39a157ee8d1efdb Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 25 Feb 2022 19:29:39 +0800 Subject: [PATCH] statistics --- pkg/statistics/statistics.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pkg/statistics/statistics.go diff --git a/pkg/statistics/statistics.go b/pkg/statistics/statistics.go new file mode 100644 index 000000000..51ff4c871 --- /dev/null +++ b/pkg/statistics/statistics.go @@ -0,0 +1,20 @@ +package statistics + +import "time" + +type Statistics struct { + Count *uint64 + Dr int +} + +func (s *Statistics) output() { + for { + time.Sleep(time.Duration(s.Dr) * time.Second) + + } +} + +func NewStatistics(count *uint64, dr int) *Statistics { + p := &Statistics{Count: count} + go p.output() +}