lkml.org 
[lkml]   [2004]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: do_gettimeofday( ) precision?
On Wed, 23 Jun 2004 17:54:13 +0200 (CEST), Lukasz Michal Rak
<l.rak@elka.pw.edu.pl> wrote:

> I don't know the way how to do it, but I wonder about
> precision of such mechanism (if any exists).

basically i want some counter w/ microsend resolution that fits into 32 bits.
couple of possible solutions come to my mind:

[1] use TSC and convert it to microsec
[2] use get_timeofday( ) and convert to microsec
[3] use xtime variable directly and convert to microsec
(any other ways?)

conversion in [1] will be costly (a div involved).
conversion in [2]/[3] can be done using bit operators. (usec|sec << 20)
but [2] will incur function call overhead which i'd like to avoid.

so is using xtime directly ok and reliable?

thanks
abhijit
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.059 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site