diff options
author | Juan Carlos <juancarlospaco@gmail.com> | 2020-04-01 14:39:58 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-01 19:39:58 +0200 |
commit | 48169847265e13d3b12d670230ad6d33a9d384cc (patch) | |
tree | 8028b0bea953b5cecefb6ba4353546b529c19bdd /lib/pure/concurrency/cpuinfo.nim | |
parent | 484548c784f69cadc1f6480a24e99183a0e6a930 (diff) | |
download | Nim-48169847265e13d3b12d670230ad6d33a9d384cc.tar.gz |
Documentation, add more examples (#13825)
Diffstat (limited to 'lib/pure/concurrency/cpuinfo.nim')
-rw-r--r-- | lib/pure/concurrency/cpuinfo.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pure/concurrency/cpuinfo.nim b/lib/pure/concurrency/cpuinfo.nim index 51f80b103..3e5695360 100644 --- a/lib/pure/concurrency/cpuinfo.nim +++ b/lib/pure/concurrency/cpuinfo.nim @@ -49,9 +49,6 @@ when defined(haiku): proc countProcessors*(): int {.rtl, extern: "ncpi$1".} = ## returns the number of the processors/cores the machine has. ## Returns 0 if it cannot be detected. - ## - ## .. code-block:: nim - ## block: doAssert countProcessors() >= 0 when defined(windows): type SYSTEM_INFO {.final, pure.} = object @@ -98,3 +95,8 @@ proc countProcessors*(): int {.rtl, extern: "ncpi$1".} = else: result = sysconf(SC_NPROCESSORS_ONLN) if result <= 0: result = 0 + + +runnableExamples: + block: + doAssert countProcessors() > 0 |