From bfe787b632e5b776a09af4c11caba54833e0be26 Mon Sep 17 00:00:00 2001 From: toast Date: Wed, 25 Oct 2023 10:54:13 +1100 Subject: [PATCH] Fix uptime being inaccurate. --- toolbox/system.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/toolbox/system.go b/toolbox/system.go index b2ae530..62e7b7b 100644 --- a/toolbox/system.go +++ b/toolbox/system.go @@ -1,9 +1,6 @@ package toolbox -import ( - "fmt" - "time" -) +import "time" /* System/OS-related utilities such as uptime. @@ -18,10 +15,5 @@ var timerStart = time.Now() func GetUptime() string { uptime := time.Since(timerStart) roundedUp := uptime.Round(time.Second) - days := roundedUp / (24 * time.Hour) - hours := roundedUp % (24 * time.Hour) / time.Hour - if days > 0 { - return fmt.Sprintf("%dd,%dh", days, hours) - } return roundedUp.String() }