diff options
| author | Jeff Carr <[email protected]> | 2024-01-21 02:23:47 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-21 02:23:47 -0600 |
| commit | 433d83e63678e4483e1d8af2e522c7b05c7d7909 (patch) | |
| tree | 7a6168fd19f27c5af9b241c45d0fe33ef9be21d7 /timer.go | |
| parent | fdac7e7b8944d51b8207c1797edd0be9450de7b8 (diff) | |
fix name changesv0.5.6
new gadgets
correct go mod
updated paths
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'timer.go')
| -rw-r--r-- | timer.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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) } |
