Creates a function to normalize unsigned counter timestamps relative to an initial value,
correctly handling wrap-around for counters with any bit width from 1 to 32 bits.
This is useful when timestamps from a hardware or software counter may wrap around,
and you want strictly increasing normalized timestamps starting from zero.
Returns
A function that takes a timestamp and returns a normalized, strictly increasing timestamp.
Creates a function to normalize unsigned counter timestamps relative to an initial value, correctly handling wrap-around for counters with any bit width from 1 to 32 bits.
This is useful when timestamps from a hardware or software counter may wrap around, and you want strictly increasing normalized timestamps starting from zero.
Returns
A function that takes a timestamp and returns a normalized, strictly increasing timestamp.
Example
Example
Example
Throws
If bits is not in the range 1..32