mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-15 06:25:58 +08:00
statistics
This commit is contained in:
@@ -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()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user