This repository has been archived on 2024-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
Corn-Utility/toolbox/system.go
toast bfe787b632
All checks were successful
Build and push container image / build (push) Successful in 39s
Fix uptime being inaccurate.
2023-10-25 10:54:13 +11:00

20 lines
355 B
Go

package toolbox
import "time"
/*
System/OS-related utilities such as uptime.
*/
var timerStart = time.Now()
/*
Nor the Go or the Disgo library has a built-in
Client/Process uptime function, so I had to get creative.
*/
func GetUptime() string {
uptime := time.Since(timerStart)
roundedUp := uptime.Round(time.Second)
return roundedUp.String()
}