mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 05:56:00 +08:00
21 lines
288 B
Go
21 lines
288 B
Go
|
|
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()
|
||
|
|
}
|