From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Support for sub-second time in decoded time Date: Mon, 29 Jul 2019 10:43:55 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="113534"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 29 16:44:09 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hs6si-000TQ7-OL for ged-emacs-devel@m.gmane.org; Mon, 29 Jul 2019 16:44:09 +0200 Original-Received: from localhost ([::1]:52750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs6sh-0003qb-Pf for ged-emacs-devel@m.gmane.org; Mon, 29 Jul 2019 10:44:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34317) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs6sa-0003jP-L4 for emacs-devel@gnu.org; Mon, 29 Jul 2019 10:44:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs6sZ-0001LS-MZ for emacs-devel@gnu.org; Mon, 29 Jul 2019 10:44:00 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3810) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hs6sZ-0001J6-GN for emacs-devel@gnu.org; Mon, 29 Jul 2019 10:43:59 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DD607811E0; Mon, 29 Jul 2019 10:43:57 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 60B9F8107A; Mon, 29 Jul 2019 10:43:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1564411436; bh=6xhsrDC2gOlnaaBQ1pb3PQIgFaDmBxG2Q5uLvj45UN0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VYHhrO9PogqWYqhvlDCxjU6tZpExRBVV+CchxmD+BqSfdbKwpVJG8ryfiM/OL76Do tNBDRTnLHrOdO4cH37VCm+Nrct7W+d2CVfzl1IFVePoNnKYnoXE0/rFEOuJwKqXSOC 8EMVdJvIb2AUSciBn2JIPIch8WuA7Ar9GJYYuyjd6biOtb18a7Tekt91BHhPVWeIXG lbvMc9JR3NpbAsSbKFjPgUMqi+22pIl6vGvJsZQoRyAdnF3PJALwKP6oTVgV+aYxFM uNaY0PW8WVVpbpwdKACFtZL/jXaeY+HLBbmWqYZKc+wj9zhqva4jRVqo5ka3zl16nh 6VkBjIOhzglVA== Original-Received: from pastel (unknown [216.154.19.233]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 24C3F120B2F; Mon, 29 Jul 2019 10:43:56 -0400 (EDT) In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 29 Jul 2019 16:12:34 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239001 Archived-At: Lars Ingebrigtsen [2019-07-29 16:12:34] wrote: > Stefan Monnier writes: > >>> `current-time' returns its data as (HIGH LOW USEC PSEC), but now that we >>> have bignum support, perhaps we don't need to do it this way. What >>> about just having a field in decoded times that's the fraction of a >>> second? So 34.5603 seconds would be represented as >>> >>> (34 ... 5603) >> >> `encode-time` uses a fraction-representation (NOM . DENOM), which is >> probably easier to manipulate. > > You mean internally? No, as yet-another format. > It doesn't seem to be mentioned in the doc string, > but it's an entire essay now... It's here: If FORM is a positive integer, the time is returned as a pair of integers (TICKS . FORM), where TICKS is the number of clock ticks and F= ORM is the clock frequency in ticks per second. (Currently the positive integer should be at least 65536 if the returned value is expected to be given to standard functions expecting Lisp timestamps.) If FORM is t, the time is returned as (TICKS . PHZ), where PHZ is a platform depen= dent clock frequency in ticks per second. If FORM is =E2=80=98integer=E2=80= =99, the time is -- Stefan