mirror of
https://github.com/simon-ding/polaris.git
synced 2026-02-06 23:21:00 +08:00
14 lines
159 B
Go
14 lines
159 B
Go
package uptime
|
|
|
|
import "time"
|
|
|
|
var startTime time.Time
|
|
|
|
func Uptime() time.Duration {
|
|
return time.Since(startTime)
|
|
}
|
|
|
|
func init() {
|
|
startTime = time.Now()
|
|
}
|