blob: 0ba5fafa3b7befc268a2bba78dd6707b82a0f3c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package repostatus
import (
"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
return time.Since(startTime) // Calculate the elapsed time
}
func (ls *RepoStatus) SetSpeedActual(s string) {
if ! ls.Ready() {return}
ls.speedActual.SetText(s)
}
|