Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2004 15:56:56 -0500 (EST)
From:      Robert Watson <rwatson@freebsd.org>
To:        Don Bowman <don@sandvine.com>
Cc:        "'freebsd-current@freebsd.org'" <freebsd-current@freebsd.org>
Subject:   Re: system call performance 4.x vs 5.x [and UP vs MP]
Message-ID:  <Pine.NEB.3.96L.1040128155501.23469M-100000@fledge.watson.org>
In-Reply-To: <Pine.NEB.3.96L.1040128130303.47712P-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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@fledge.watson.org      Senior Research Scientist, McAfee Research




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040128155501.23469M-100000>