cpu_fallback.go 300 B

1234567891011121314151617
  1. //go:build !unix
  2. package cpu
  3. import (
  4. "time"
  5. )
  6. // The fallback always determines that the CPU limits are not reached
  7. func ProbeCPUs(probeTime time.Duration, maxCPUUsage float64, abort chan struct{}) bool {
  8. select {
  9. case <-abort:
  10. return false
  11. case <-time.After(probeTime):
  12. return true
  13. }
  14. }