lkml.org 
[lkml]   [1999]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux system timing
Lars Marowsky-Bree wrote:

> On 1999-09-05T05:35:39,
> david <sector2@ihug.co.nz> said:
>
> > we need a better time system for linux glibc
>
> Your proposal is interesting. But why?
>
> What shortcomings of the current approach are you trying to solve which
> require the use of floats (in the kernel even!)? Low resolution, short
> timespan, the y2.038k problem?
>
> > struct {
> > double count ;
> > double clocks_per_sec ;
> > }
> > so time = count / clocks_per_sec
>
> I don't quite think this approach is going to provide you with as high a
> resolution as you expect, but my memories of how floats work might be flawed.
>
> > is someone all ready doing this
>
> Hopefully not, but please explain your reasons behind this. Maybe I am getting
> it all wrong.
>
> > linux can be the beast computing tool lets make it so
>
> Wait until 6.6.6 gets out! It will even be a stable branch, featuring the 4
> network layers of the apocalypse! ;-)
>
> Sincerely,
> Lars Marowsky-Brée
>
> --
> Lars Marowsky-Brée
> Network Management
>
> teuto.net Netzdienste GmbH

it all started when i was testing some code for copy data to a frame buffer for
speed
i was using a 32 bit int ( clock_t = clock() ; ) which is clocked at 1 Mhz
the problem is that the register will rollover in ( 2^32 / 1 * 10^6 = 71.58
minutes )
and my tests may last longer than 71.58 minutes also the resolution is only 1 us

i was wrong about the internel cpu counter it is 64 bit not 32 bit ( good this
will solve the problem)
i can use the rdtsc instruction but the code will only work on intel cpu's so it
would be good if there was a sandard way of accessing high resolution counters on
any linux platform

floats will only loose LSB resolution if you overload the significand part of the
fpu register
to stop this when the significand part is at is max +1 reset it to 0




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

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