summaryrefslogtreecommitdiff
path: root/pkg/sysinfo/numcpu.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sysinfo/numcpu.go')
-rw-r--r--pkg/sysinfo/numcpu.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/sysinfo/numcpu.go b/pkg/sysinfo/numcpu.go
new file mode 100644
index 000000000..aeb1a3a80
--- /dev/null
+++ b/pkg/sysinfo/numcpu.go
@@ -0,0 +1,12 @@
+// +build !linux,!windows
+
+package sysinfo
+
+import (
+ "runtime"
+)
+
+// NumCPU returns the number of CPUs
+func NumCPU() int {
+ return runtime.NumCPU()
+}