lkml.org 
[lkml]   [2002]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: a faster way to gettimeofday?


Davide Libenzi wrote:

> On Tue, 5 Mar 2002, Ben Greear wrote:
>
>
>>I have a program that I very often need to calculate the current
>>time, with milisecond accuracy. I've been using gettimeofday(),
>>but gprof shows it's taking a significant (10% or so) amount of
>>time. Is there a faster (and perhaps less portable?) way to get
>>the time information on x86? My program runs as root, so should
>>have any permissions it needs to use some backdoor hack if that
>>helps!
>>
>
> If you're on x86 you can use collect rdtsc samples and convert them to ms.
> You'll get even more then ms accuracy.


Can I do this from user space? If so, any examples or docs
you can point me to?

Also, I'm looking primarily for a speed increase, not an accuracy
increase.

Thanks for the response!

Ben


>
>
>
>
> - Davide
>
>
>
> -
> 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/
>
>


--
Ben Greear <greearb@candelatech.com> <Ben_Greear AT excite.com>
President of Candela Technologies Inc http://www.candelatech.com
ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear


-
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 13:24    [W:0.515 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site