Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Nov 1997 02:24:26 -0800 (PST)
From:      Jeffrey Hsu <hsu>
To:        hackers
Subject:   Re: gettimeofday() overhead
Message-ID:  <199711041024.CAA01699@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
>Since timing measurements don't have to be
>particularly accurate for libalias, does anyone
>have an idea how time might be measured
>entirely in user space?

If you had threads, you could have a thread which calls gettimeofday()
once a second, storing it into a variable.  This is what Sun's Java
Web Server does to avoid calling gettimeofday() on each web hit. 

If you knew where the time was in kernel memory, you could map it
into your address space and read it.  This is what Digital's X 
server does to timestamp X events.

You could try setting a timer to go off once a second and update your
cached time of day variable.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711041024.CAA01699>