mirror of
https://github.com/muety/wakapi.git
synced 2025-12-05 22:20:24 -08:00
15 lines
175 B
Go
15 lines
175 B
Go
package utils
|
|
|
|
import (
|
|
"math"
|
|
"runtime"
|
|
)
|
|
|
|
func AllCPUs() int {
|
|
return runtime.NumCPU()
|
|
}
|
|
|
|
func HalfCPUs() int {
|
|
return int(math.Ceil(float64(runtime.NumCPU()) / 2.0))
|
|
}
|