date +'%N' doesn't work on OSX #11
Description
-
date +'%N' doesn't work on OSX:
(was introduced here: 1e64c88)
date +'%N'
N -
there's perhaps gdate if user installed it via brew install binutils, eg:
gdate +'%N'
225945000 -
maybe it'd be a good idea to mixin thread-id and/or pid to avoid potential clashes where 2 threads calling same code generate same seed (hence, same tempfile)
-
in D,
unpredictableSeed
does a mix of pid, threadid, and time:
https://github.com/dlang/phobos/blob/e87b111162df48db747d535715817a37cefba6b1/std/random.d#L1685 -
this is very related to these issues:
there really should be 1 function that could be called for all these cases (or possibly, 1 for CT case and 1 for RT case), but happy to have it working in isolation in tempfile.nim for now
note
see #12 for a robust way to solve this