make 'nim doc times.nim' work on old versions of OSX again

This commit is contained in:
Andreas Rumpf
2019-03-04 08:50:28 +01:00
parent 2647653589
commit f9231eb569

View File

@@ -2525,7 +2525,7 @@ when not defined(JS):
fib.add(fib[^1] + fib[^2])
echo "CPU time [s] ", cpuTime() - t0
echo "Fib is [s] ", fib
when defined(posix):
when defined(posix) and not defined(osx):
# 'clocksPerSec' is a compile-time constant, possibly a
# rather awful one, so use clock_gettime instead
var ts: Timespec