You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
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()
|
|
}
|