[quagga-dev 5860] Re: Monotonic time, RFC

paul at clubi.ie paul at clubi.ie
Tue Sep 2 13:55:33 BST 2008

On Tue, 2 Sep 2008, Joakim Tjernlund wrote:

> Well, I could not resist :) What do you think of this?
> No more jumps for relative time.

How much does this matter? Let's just enable the CLOCK_MONOTONIC 
code ;).

> +  relative_time.tv_sec += diff / clocks_per_sec; /* convert to seconds */
> +  relative_time.tv_usec += ((diff % clocks_per_sec) * TIMER_SECOND_MICRO) / clocks_per_sec;
> +  timeval_adjust (relative_time);

Ouch, this could hurt on weaker systems. You're much better off 
taking the time to accurately work out (1/clocks_per_sec) *once*, so 
that this often-called timer update function only has to do diff * 

Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Blessed are the young, for they shall inherit the national debt.
 		-- Herbert Hoover

More information about the Quagga-dev mailing list