
Dear Albert ARIBAUD,
In message 4D3D2942.4060600@free.fr you wrote:
- get_timer() works in pure ticks, not ms, and thus does not need
multiply/divide; it may at most need to implement a carry over from 32 bit to 64 bits *if* the HW counter is 32 bits *and if* we want a 64-bit virtual counter.
- get_time() works in ms, and thus needs scale conversion, so possibly a
multiply/divide but possibly some other method, to convert a tick value to an ms value.
No. There is get_ticks(), which operates on ticks, and there is get_timer(), which returns milliseconds.
That's where I come back to one point of my proposal: if we can get a general framework for get_timer() to return a 64-bit free-running tick value, then we might not need a ms-based get_time() at all, because we could use get_timer() as well for ms timings, provided we can convert
Then you will always have to use 64 bit variables for all related operations. Note that get_timer() returns "unsigned long"", which allows for smaller code in the majority of use cases.
Best regards,
Wolfgang Denk