Re: 64bit time_t

Iljitsch van Beijnum <iljitsch@muada.com> Mon, 23 June 2008 19:57 UTC

Return-Path: <ietf-bounces@ietf.org>
X-Original-To: ietf-archive@megatron.ietf.org
Delivered-To: ietfarch-ietf-archive@core3.amsl.com
Received: from [127.0.0.1] (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id A6B5E3A694C; Mon, 23 Jun 2008 12:57:15 -0700 (PDT)
X-Original-To: ietf@core3.amsl.com
Delivered-To: ietf@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id F35BD3A694C for <ietf@core3.amsl.com>; Mon, 23 Jun 2008 12:57:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pn8fqCTf-VEY for <ietf@core3.amsl.com>; Mon, 23 Jun 2008 12:57:13 -0700 (PDT)
Received: from sequoia.muada.com (unknown [IPv6:2001:1af8:2:5::2]) by core3.amsl.com (Postfix) with ESMTP id C43D63A6929 for <ietf@ietf.org>; Mon, 23 Jun 2008 12:57:12 -0700 (PDT)
Received: from [192.168.0.192] (static-167-138-7-89.ipcom.comunitel.net [89.7.138.167] (may be forged)) (authenticated bits=0) by sequoia.muada.com (8.13.3/8.13.3) with ESMTP id m5MHiuZ8046872 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 22 Jun 2008 19:44:57 +0200 (CEST) (envelope-from iljitsch@muada.com)
Message-Id: <16EF8F43-A771-4C57-A17C-C6B65389F2C3@muada.com>
From: Iljitsch van Beijnum <iljitsch@muada.com>
To: Chad Giffin <typosity@hotmail.com>
In-Reply-To: <BLU120-W240BCEF0CF3ACCC84DFBF3CAA40@phx.gbl>
Mime-Version: 1.0 (Apple Message framework v924)
Subject: Re: 64bit time_t
Date: Sun, 22 Jun 2008 19:45:26 +0200
References: <BLU120-W240BCEF0CF3ACCC84DFBF3CAA40@phx.gbl>
X-Mailer: Apple Mail (2.924)
Cc: IETF <ietf@ietf.org>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: IETF Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/pipermail/ietf>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes"
Sender: ietf-bounces@ietf.org
Errors-To: ietf-bounces@ietf.org

On 21 jun 2008, at 20:38, Chad Giffin wrote:

> Make time_t 64 bits wide.  Make the most significant bit (bit 63) a  
> sign bit.  Make the next 50 significant bits store the number of  
> seconds elapsed since January 1st 2000 GMT.  The last 13 bits be of  
> fractions of a second.

Compute time in 1/8192s of a second? That seems highly unworkable.

Also, what kind of time are we talking about? We all like to live  
under the assumption that a day is 86400 seconds long, but  
unfortunately, the definitions of "day", "86400" and "second" are such  
that this is not the case, so there are different kinds of time that  
make different kinds of compromises, like as leap seconds for UTC.

Note that leap seconds make converting between UTC and the actual  
number of seconds since any chosen epoch a non-trivial exercise for  
the present and the past, and impossible for the future without  
deviating from the definition of "second".

Last but not least, common C APIs already support microsecond  
resolution for timing, I forget the exact name, though.

> What do you think?

I think using a single value for high precision timing as well as  
calendar timing is asking for trouble. Then again, there are also  
people who think changing your clock is a good way to get up a bit  
earlier in the summer.
_______________________________________________
IETF mailing list
IETF@ietf.org
https://www.ietf.org/mailman/listinfo/ietf