From 433d83e63678e4483e1d8af2e522c7b05c7d7909 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 21 Jan 2024 02:23:47 -0600 Subject: fix name changes new gadgets correct go mod updated paths Signed-off-by: Jeff Carr --- timer.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'timer.go') diff --git a/timer.go b/timer.go index 17130f3..991961a 100644 --- a/timer.go +++ b/timer.go @@ -1,15 +1,15 @@ package linuxstatus import ( - "time" "sort" "strings" + "time" ) // timeFunction takes a function as an argument and returns the execution time. func timeFunction(f func()) time.Duration { - startTime := time.Now() // Record the start time - f() // Execute the function + startTime := time.Now() // Record the start time + f() // Execute the function return time.Since(startTime) // Calculate the elapsed time } @@ -31,6 +31,8 @@ func sortLines(input string) string { } func (ls *LinuxStatus) SetSpeedActual(s string) { - if ! ls.Ready() {return} - ls.speedActual.Set(s) + if !ls.Ready() { + return + } + ls.speedActual.SetValue(s) } -- cgit v1.2.3