v/vlib/runtime/runtime.v

15 lines
156 B
V
Raw Normal View History

2019-10-11 05:36:46 +02:00
module runtime
$if linux {
#include <sys/sysinfo.h>
fn C.get_nprocs() int
}
pub fn nr_cpus() int {
$if linux {
return C.get_nprocs()
}
return 0
}