Messages in this thread | | | Date | Wed, 23 Jun 2004 17:54:13 +0200 (CEST) | From | Lukasz Michal Rak <> | Subject | Re: 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/
| |