v/vlib/runtime/runtime_windows.c.v

12 lines
173 B
V
Raw Normal View History

2019-10-11 13:16:02 +02:00
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
}