diff options
| author | Jeff Carr <[email protected]> | 2024-01-03 18:15:54 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-03 18:15:54 -0600 |
| commit | 0a20b22a6c13c2ccf6a914cd847be9e3f744b343 (patch) | |
| tree | bd8bcde875b5d88e5f890331dfb3cafc12b05b23 /watchdog.go | |
| parent | 3f42ba188239c0c367718348515bd1b825196c7a (diff) | |
move to go.wit.com/log !!!
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'watchdog.go')
| -rw-r--r-- | watchdog.go | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/watchdog.go b/watchdog.go index e80861f..a57005c 100644 --- a/watchdog.go +++ b/watchdog.go @@ -2,6 +2,8 @@ package gui import ( "time" + + "go.wit.com/log" ) var watchtime time.Duration = 100 // in tenths of seconds @@ -16,43 +18,8 @@ var watchtime time.Duration = 100 // in tenths of seconds func Watchdog() { var i = 1 for { - log(logInfo, "gui.Watchdog() is alive. give me something to do.", i) - if (me.rootNode == nil) { - log(logInfo, "me.rootNode == nil", i) - } else { - if (logVerbose) { - me.rootNode.ListChildren(true) - } - } + log.Verbose("gui.Watchdog() is alive. give me something to do.", i) i += 1 time.Sleep(watchtime * time.Second / 10) } } -// https://www.reddit.com/r/golang/comments/12em87q/how_to_run_periodic_tasks/ -/* -package main - -import ( - "fmt" - "time" -) - -func main() { - ticker := time.NewTicker(time.Second) - defer ticker.Stop() - done := make(chan bool) - go func() { - time.Sleep(10 * time.Second) - done <- true - }() - for { - select { - case <-done: - fmt.Println("Done!") - return - case t := <-ticker.C: - fmt.Println("Current time: ", t) - } - } -} -*/ |
