All of lore.kernel.org
 help / color / mirror / Atom feed
* gettimeofday() resolution in Linux?
@ 2008-04-10 14:40 Jack Harvard
  2008-04-10 15:04 ` Lennart Sorensen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jack Harvard @ 2008-04-10 14:40 UTC (permalink / raw)
  To: linux-kernel

Hi,

I would like to ask a few questions about how Linux keeps time.

As far as I understand,
1. Linux's time resolution is 10ms, as defined by HZ=100.
2. gettimeofday() can get time in microseconds, but I'm not sure about
the accuracy of the time finer than 10ms. Sometimes gettimeofday( )
can even give me microseconds results rolled backwards in time, which
I suspect could be caused by its accuracy. My question here is "how
accurate is the time from gettimeofday()"
3. If I want to increase the time resolution to 1ms, I can possibly
change HZ=1000, but if I want 1usec resolution, how can I do that? It
would be too busy for the processor to handle so frequent timer
interrupts if I just increase HZ=1000000.

Many thanks/muchas gracias/Danke vielmals!

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-04-10 18:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-10 14:40 gettimeofday() resolution in Linux? Jack Harvard
2008-04-10 15:04 ` Lennart Sorensen
2008-04-10 15:35   ` Andi Kleen
2008-04-10 15:59   ` Jack Harvard
2008-04-10 17:41     ` Bart Van Assche
     [not found]       ` <a72f6a3c0804101057i10c572bak1dd09f0c7fd75d30@mail.gmail.com>
2008-04-10 18:02         ` Bart Van Assche
2008-04-10 15:49 ` Chris Friesen
2008-04-10 16:07 ` Bart Van Assche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.