v/vlib/runtime/runtime_windows.c.v

12 lines
173 B
V

module runtime
import os
pub fn nr_cpus() int {
mut nr := int(C.GetCurrentProcessorNumber())
if nr == 0 {
nr = os.getenv('NUMBER_OF_PROCESSORS').int()
}
return nr
}