lkml.org 
[lkml]   [2004]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: do_gettimeofday( ) precision?
On Wed, 23 Jun 2004, abhijit wrote:

> hello,
>
> the comment on top of do_gettimeofday( ) [arch/i386/kernel/time.c] says:
>
> /*
> * This version of gettimeofday has microsecond resolution
> * and better than microsecond precision on fast x86 machines with TSC.
> */
> void do_gettimeofday(struct timeval *tv)
> {
> ...
>
> but the code below limits usec to <= 1000000. so isn't the resolution
> not limited to microsec even on TSC capable boxes?
>
> if one wants higher resolution (for timestamping etc.) whats the preferred
> way?
>
> thanks
> abhijit

Hi!

I think you are right that do_gettimeofday() is limited to microsec even
on boxes with TSC register. This function returns only seconds and
microseconds so you won't get better resolution with it. I don't know the
way how to do it, but I wonder about precision of such mechanism (if any
exists).
Regards,

Lukasz
-
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.084 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site