stash/vendor/github.com/knq/sysutil/sysutil.go
bnkai 4373f9bf01
Add cdp support for xpath scrapers (#625)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-08-04 10:42:40 +10:00

15 lines
268 B
Go

package sysutil
import "time"
var btime time.Time
// BootTime returns the time the system was started.
func BootTime() time.Time {
return btime
}
// Uptime returns the duration the system has been up.
func Uptime() time.Duration {
return time.Now().Sub(btime)
}