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

19 lines
331 B
Go
Raw Normal View History

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