diff options
Diffstat (limited to 'timer.go')
| -rw-r--r-- | timer.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -6,12 +6,14 @@ import ( // 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 } func (ls *RepoStatus) SetSpeedActual(s string) { - if ! ls.Ready() {return} + if !ls.Ready() { + return + } ls.speedActual.SetText(s) } |
