2 ms·
Don't even need the "same millisecond" part to save a few cycles, use case depending. An overflowing increment with a counter of any sort plus a few random bits
by junon 3y ago
Don't even need the "same millisecond" part to save a few cycles, use case depending. An overflowing increment with a counter of any sort plus a few random bits is usually enough.
If you're clever enough, neither needs a branch.
- SV_BubbleTime 3y agoUUIDv7 has two at least two such monotonic strategies. You can use a counter, or you can use those bytes to increase the random entropy.