Added RunningSince to cgr-console status

This commit is contained in:
Trial97
2019-02-20 14:03:53 +02:00
committed by Dan Christian Bogos
parent db7826a5d7
commit f4d6f4fca8
2 changed files with 15 additions and 0 deletions

View File

@@ -46,6 +46,20 @@ import (
"github.com/cgrates/rpcclient"
)
var startCGRateSTime time.Time
func init() {
startCGRateSTime = time.Now()
}
func GetTimeElapsedFromStart() string {
return time.Now().Sub(startCGRateSTime).Round(time.Second).String()
}
func GetStartTime() string {
return startCGRateSTime.Format(time.UnixDate)
}
func NewCounter(start, limit int64) *Counter {
return &Counter{
value: start,