Date: Sun, 16 Nov 1997 19:47:03 -0800 (PST) From: "Jamil J. Weatherbee" <jamil@trojanhorse.ml.org> To: Charles Mott <cmott@srv.net> Cc: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>, hackers@FreeBSD.ORG Subject: Re: Reading kernel memory Message-ID: <Pine.BSF.3.96.971116191826.1896A-100000@trojanhorse.ml.org> In-Reply-To: <Pine.BSF.3.96.971116140323.10522A-100000@darkstar.home>
next in thread | previous in thread | raw e-mail | index | archive | help
> Does anyone know what the response time for gettimeofday() is on a
> reasonably modern Pentium? It is about 60 microseconds on my ancient 386.
I wrote some test code for this, included below.
My results (as measured by this code)
Machine Calls Latency
PPro-180 999998 4.06us
Nexgen P-100 999977 23.92us
Pentium-100 999987 4.81us
Cyrix-PR166 999996 5.82us
I guess that kinda says something bad about that NexGen machine I used to
test the AIOX driver, mainly that it is slow, which for testing I guess is
kinda good. Maybye it is just slower in the call gate or something because
computational I think it is a bit faster than the Pentium 100 (at least
that is my experience with the equally equipped machines).
------------------------ The Code -------------------------------------
#include <sys/time.h>
#include <stdio.h>
#define TESTLEN 1000000
void main (void)
{
struct timeval a,b;
long d;
long t = 0;
int x, c= 0;
for (x=0;x<TESTLEN;x++)
{
gettimeofday (&a, NULL);
gettimeofday (&b, NULL);
if ((a.tv_sec == b.tv_sec) && (d = b.tv_usec - a.tv_usec))
{ c++; t += d;}
}
printf ("Summary %d gettimeofday() pair calls, mean latency = %0.2fus\n",
c, (float)t / c);
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971116191826.1896A-100000>
