diff options
Diffstat (limited to 'watchdog.go')
| -rw-r--r-- | watchdog.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/watchdog.go b/watchdog.go new file mode 100644 index 0000000..29ac21a --- /dev/null +++ b/watchdog.go @@ -0,0 +1,23 @@ +package gui + +import ( + "log" + "time" +) + +var watchtime time.Duration = 100 // in tenths of seconds + +/* + This program sits here. + If you exit here, the whole thing will os.Exit() + + This goroutine can be used like a watchdog timer +*/ +func Watchdog() { + var i = 1 + for { + log.Println("watchdog timer is alive. give me something to do.", i, "debug =", Config.Debug.Debug) + i += 1 + time.Sleep(watchtime * time.Second / 10) + } +} |
