diff options
| author | Jeff Carr <[email protected]> | 2023-12-21 17:56:56 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-21 17:56:56 -0600 |
| commit | 73b0cee93320bb5b572881cd1a5ba9d878a4ba3a (patch) | |
| tree | 615e3c84e31ce55ac83399409eb068c979dff2e5 /main.go | |
| parent | 7409b58ea37becdd7fba7d3da8e1994aa55f7922 (diff) | |
add a DurationSlider()v0.2.2
widgets to adjust timeouts
redo bash curl.sh example
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -69,8 +69,14 @@ func timeFunction(f func()) time.Duration { return time.Since(startTime) // Calculate the elapsed time } */ + timer2 := time.NewTimer(time.Second) + go func() { + <-timer2.C + fmt.Println("Timer 2 fired") + }() + for { - sleep(me.dnsTTLsleep) + time.Sleep(me.ttl.Duration) if (time.Since(lastLocal) > me.localSleep) { if (runtime.GOOS == "linux") { duration := timeFunction(linuxLoop) @@ -82,10 +88,17 @@ func timeFunction(f func()) time.Duration { } lastLocal = time.Now() } - if (time.Since(lastDNS) > me.dnsSleep) { + if (time.Since(lastDNS) > me.dnsTtl.Duration) { DNSloop() lastDNS = time.Now() } + + /* + stop2 := timer2.Stop() + if stop2 { + fmt.Println("Timer 2 stopped") + } + */ } } |
