Allow C++ code to evaluate time base conversion routines at compile time
by marking them as constexpr where possible.
Signed-off-by: Josh Gao <josh@jmgao.dev>
Some use cases require using high-resolution tick or cycle clocks to
measure sub-millisecond durations. Generate the corresponding 32-bit
conversions to avoid the cost of 64-bit math in the common case where
the duration fits in 32 bits in both original and converted scale.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>