3 ms·
We're not talking about nanoseconds of real time; we're talking about nanoseconds as measured by the CPU doing the processing. Nanoseconds are not likely to be
by mlyle 2y ago
We're not talking about nanoseconds of real time; we're talking about nanoseconds as measured by the CPU doing the processing. Nanoseconds are not likely to be a uniform variate.
- UltraSane 2y agoYes and they are also not likely to be so non-uniform that more than 6.411 billion billion events all happen in one nanosecond.
- mlyle 2y agoNote it's not that number, but roughly the square root of that number, that matters. And they might be quite non-uniform. If the scheduler tick and the nanosecond clock are synchronous, you could end up with a few thousand popular values instead of a billion. It's not a real concern today, and probably won't be a real concern in 10 years, but it's not so far removed from possibility that no one has to think about it.
- UltraSane 2y agoGood point about the square root of the random part. I guess that is why the 63 bit Snowflake ID uses a sequential counter.