Re: [go-nuts] Windows - syscall.GetProcessTimes() always shows 0 values.

2017-06-01 Thread Steven Hartland
All depends on what your going to end up doing. If code will deal with processes other than itself then pid is arguably easier to deal with, however if you only ever deal with your process then I would have the NewProcInfo method just setup the handle as you had it (reducing the number of sysc

Re: [go-nuts] Windows - syscall.GetProcessTimes() always shows 0 values.

2017-05-31 Thread kevin . michael . lloyd
Steven, your example is really helpful! I didn't know Windows had a lower time interval for internal timers, so that's good to know, thanks for getting me unstuck! Thought I was losing my mind. Is there a reason to pass the PID around instead of using the pseudo handle? I'm new to the core Wind

Re: [go-nuts] Windows - syscall.GetProcessTimes() always shows 0 values.

2017-05-31 Thread Steven Hartland
Your main problem is the fact that the Windows time interval is 16ms by default. It uses this value for its internal timers and thread time quantum, which effectively means you won't see any changes until they have added up to a min of 16ms. You can see this by changing the 16ms in the following e

[go-nuts] Windows - syscall.GetProcessTimes() always shows 0 values.

2017-05-31 Thread kevin . michael . lloyd
I am trying to query the process statistics against the runtime in Windows so I can monitor it's utilisation. First, I get the process handle for the runtime: // GetCurrentProcess will return our process handle with the appropriate information. func GetCurrentProcess() (syscall.Handle, error) {