Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Oct 2001 12:15:00 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Peter Wemm <peter@wemm.org>, arch@FreeBSD.ORG
Subject:   Re: 64 bit times revisited.. 
Message-ID:  <200110261914.PAA17908@devonshire.cnchost.com>
In-Reply-To: Your message of "Fri, 26 Oct 2001 20:34:58 %2B0200." <5685.1004121298@critter.freebsd.dk> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >Okay, how about this?  Define N types that will be
> >*exactly* the same on *all* machines:
> >
> >    time_t	 32 bits	(1 second resolution, upto yr 2038)
> >    nstime64_t	 64 bits	(10^-9 second resolution, upto yr 2554)
> 
> Should be 1/2^32 resolution or you have a math nightmare dividing
> by 1000000000 all the time.

On my 500Mhz PIII it takes about 4.6ns to divide a 64 bit
number by a 64 bit 10^9.

> >    zstime128_t	128 bits	(10^-21 second resolution, 10 billion yrs) 
> 
> here: resolution 1/2^64 second.
> 
> Decimal computers lost the race and they ain't coming back.  We want
> arithmetic on binary computers to be fast and simple.

Most everyone uses powers of ten for timing units.  Remember,
millisecond, microsecond, nanosecond, picosecond?!  All test
equipment time in units of 10s not 2s.  That is also why CPUs
have clock rate in multiples of 10^6 Hzs not 2^20.  It is
just being practical even if division by a power of 10 is a
bit of a pain.

> >BTW, this discussion should be conducted on comp.std.internat
> >as it affects all OSes, not just FreeBSD.
> 
> Well, sorry, ENOTIME from here.

Well, *someone* from FreeBSD core should be participating.
At least tell people there what you are planning to do.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110261914.PAA17908>