catbase/bot/stats/stats.go

20 lines
281 B
Go

package stats
import (
"time"
)
type Stats struct {
MessagesSent int
MessagesRcv int
startTime time.Time
}
func New() *Stats {
return &Stats{startTime: time.Now()}
}
func (s Stats) Uptime() string {
return time.Now().Sub(s.startTime).Truncate(time.Second).String()
}