Skip to content

Instantly share code, notes, and snippets.

@plutov
Created June 11, 2019 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plutov/53697ea7892b4f05bafc749c2f436f8e to your computer and use it in GitHub Desktop.
Save plutov/53697ea7892b4f05bafc749c2f436f8e to your computer and use it in GitHub Desktop.
wails-4
func (s *Stats) WailsInit(runtime *wails.Runtime) error {
s.log = runtime.Log.New("Stats")
go func() {
for {
runtime.Events.Emit("cpu_usage", s.GetCPUUsage())
time.Sleep(1 * time.Second)
}
}()
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment