2019-10-11 13:16:02 +02:00
|
|
|
module runtime
|
2019-11-15 14:14:28 +01:00
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
fn nr_cpus_win() int {
|
|
|
|
mut nr := int(C.GetCurrentProcessorNumber())
|
|
|
|
if nr == 0 {
|
|
|
|
nr = os.getenv('NUMBER_OF_PROCESSORS').int()
|
|
|
|
}
|
|
|
|
return nr
|
|
|
|
}
|
|
|
|
|
|
|
|
fn nr_cpus_nix() int {
|
|
|
|
eprintln('nr_cpus_nix should be callable only for nix platforms')
|
|
|
|
return 1
|
|
|
|
}
|