Re: system call performance 4.x vs 5.x [and UP vs MP]

From: Robert Watson <rwatson_at_freebsd.org>
Date: Wed, 28 Jan 2004 15:56:56 -0500 (EST)
On Wed, 28 Jan 2004, Robert Watson wrote:

>         printf("%d.%09lu for %d iterations\n", ts_end.tv_sec,
>             ts_end.tv_nsec, NUM);
>         printf("%d.%09lu per/iteration\n", ts_end.tv_sec / NUM,
>             ts_end.tv_nsec / NUM);

Having posted this, I should point out that this suffers an error if you
get above a second total measurement time (which I generally don't do to
avoid being preempted).  Something like the following would work slightly
better: 

	ts_end.tv_sec *= 1000000000 / count;
	printf("0.%09lu per/iteration\n", ts_end.tv_sec +
	    ts_end.tv_nsec / count);

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert_at_fledge.watson.org      Senior Research Scientist, McAfee Research
Received on Wed Jan 28 2004 - 11:59:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:40 UTC