MCPcopy Create free account
hub / github.com/FastLED/FastLED / cpu_count

Function cpu_count

ci/util/cpu_count.py:4–10  ·  view source on GitHub ↗

Get the number of CPUs.

()

Source from the content-addressed store, hash-verified

2
3
4def cpu_count() -> int:
5 """Get the number of CPUs."""
6 # Force sequential execution if NO_PARALLEL is set
7 no_parallel = os.environ.get("NO_PARALLEL", "0") in ["1", "true", "True"]
8 if no_parallel:
9 return 1
10 return os.cpu_count() or 1

Callers 2

concurrent_runFunction · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected