* gettimeofday() - execution time and underlying implementation details
@ 2009-02-06 14:30 Cagri Balkesen
0 siblings, 0 replies; only message in thread
From: Cagri Balkesen @ 2009-02-06 14:30 UTC (permalink / raw)
To: linux-kernel
Dear all,
I have a question regarding gettimeofday() function on Linux. I wrote a simple benchmark to understand the execution time of gettimeofday() function. I used ACE High Resolution Timer library to measure the timings (which in fact uses rdtsc instruction). My measurements claim that it takes 1.7 usecs as median and 1.8 usecs as mean value. Which is quite big for the scenario that I'm planning to use gettimeofday(). What I want to learn is whether it is doing a system call or reading the value out of a shared mapping in my system? Also I wonder what timer hardware does linux use for gettimeofday. Also I'm getting kernel timestamped datagrams from network layer (using SO_TIMESTAMP option on the socket), so another question is, does it also take around the same time when kernel receives the packets from the network and timestamps them with gettimeofday()?
Here is information about my system: Linux Red Hat 2.6.18-128.el5 #1 SMP x86_64 GNU/Linux
I'd be grateful to anyone who might share knowledge on this issue.
Thanks,
Cagri
p.s. I hope this is an appropriate message for this mailing list.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-06 14:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-06 14:30 gettimeofday() - execution time and underlying implementation details Cagri Balkesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®