mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
statistics
This commit is contained in:
parent
70b97aa856
commit
8c9d1b7dec
20
pkg/statistics/statistics.go
Normal file
20
pkg/statistics/statistics.go
Normal file
@ -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()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user