Windows: stats support

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 340e5233b2fb95981ddea610c1667134ed3b2376
Component: engine
This commit is contained in:
John Howard
2016-09-07 16:08:51 -07:00
parent 4efffd499d
commit 7342ae40e2
22 changed files with 585 additions and 323 deletions

View File

@ -50,3 +50,9 @@ func runtimeArchitecture() (string, error) {
return "", fmt.Errorf("Unknown processor architecture")
}
}
// NumProcs returns the number of processors on the system
func NumProcs() uint32 {
syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&sysinfo)), 0, 0)
return sysinfo.dwNumberOfProcessors
}