mirror of
https://github.com/vlang/v.git
synced 2025-09-14 15:02:33 +03:00
11 lines
173 B
V
11 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
|
|
}
|