From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#65251: 30.0.50; Duration in compilation buffer Date: Thu, 17 Aug 2023 00:36:52 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2678"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65251@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 17 00:38:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qWP9b-0000Tg-7G for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Aug 2023 00:38:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWP9Q-0008I7-4F; Wed, 16 Aug 2023 18:38:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWP9O-0008Hz-Od for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2023 18:38:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWP9O-0003PA-Gk for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2023 18:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qWP9O-00057r-37 for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2023 18:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Aug 2023 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65251 X-GNU-PR-Package: emacs Original-Received: via spool by 65251-submit@debbugs.gnu.org id=B65251.169222542319629 (code B ref 65251); Wed, 16 Aug 2023 22:38:02 +0000 Original-Received: (at 65251) by debbugs.gnu.org; 16 Aug 2023 22:37:03 +0000 Original-Received: from localhost ([127.0.0.1]:42292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWP8R-00056X-5Z for submit@debbugs.gnu.org; Wed, 16 Aug 2023 18:37:03 -0400 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:54774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWP8O-000561-Ld for 65251@debbugs.gnu.org; Wed, 16 Aug 2023 18:37:02 -0400 Original-Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fe501e0b4cso66908515e9.1 for <65251@debbugs.gnu.org>; Wed, 16 Aug 2023 15:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692225415; x=1692830215; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SyyIz1Dj76J779gAwU9ESttTjcVfHugbhtsEqr4sjAg=; b=QG9ta9Ta9f/PSxB+RwawVvFYX7LJu9wZ4cL/XriuaEuioLWl327zrnhsL0R/NhC010 mkshL3U98iuQmi8FDpEoOtpfZHvem2S8uP3DskQsl06rkg8Rl+rA8G2o/DTDUWQlOhQQ 4Mpb5DV9lwMGigtGPXNoIiq0daaSSmhJty2yPtrc0kNNcirOHdeXQ2GVtf60Q8CQce0a OKRqE1ZqMz551CEM3hcCRnuubTcqqUYyGQuE46cHfS07vImYH/q6HIBr5E+YhQoFLXOL gTOk5a8FsTPqp2Eigc2WwsgoxSNORsSYyDR/S3wRPGkgG+gzZZFyLnVAEXqmcULF3s87 oBQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692225415; x=1692830215; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SyyIz1Dj76J779gAwU9ESttTjcVfHugbhtsEqr4sjAg=; b=Z+iz6Jh/BrKmaQ/xYjJDPnf/WFAWckZoPggrtYMTHlrKeNy4utWPEuJQM6n8/n1x+1 5GnRlG1KpiFB67w/WpI0XLvReAqYJEeo3Wp7U3gb7xyLOBB8sMCoZnkqOGLRF3FYGML9 MDjoRef1MeEgKAnn/dOEThzWX+uDIlwVDPraA35Jx6ZYnytLmyl2PZbWpzWK2wuXu/iq ldk+K0dWC0gEjV2KcMaDDdimo5fLZoIeV3i3VIM3w3THKsmTGcbD4IlS7T8uIKeXTSs9 9czDF1NnDTb8n/XW/Z5Z54UpztnwnklNeMPUirIV2aMhjZOhUyQUznvfhAwnA9gTjwvm TFBw== X-Gm-Message-State: AOJu0YwRXshTlyK0klgBzDn1YPpJhP/1/7dz+b870FhbwHlI9D9I7JF5 I9zdVYZiq3JNHjWcMId4vVcDJ323HxY= X-Google-Smtp-Source: AGHT+IEi5lSliTOIldtYum+xAt6rDxvgjVqbwse0G2RHfEVtrKIhP+bFpnSoeSdB0ECps5aMBgo/sA== X-Received: by 2002:a7b:cd94:0:b0:3fb:403d:90c5 with SMTP id y20-20020a7bcd94000000b003fb403d90c5mr2435638wmj.39.1692225414364; Wed, 16 Aug 2023 15:36:54 -0700 (PDT) Original-Received: from caladan (dial-181023.pool.broadband44.net. [212.46.181.23]) by smtp.gmail.com with ESMTPSA id u5-20020a05600c210500b003fc02e8ea68sm780623wml.13.2023.08.16.15.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 15:36:53 -0700 (PDT) In-Reply-To: ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Wed, 16 Aug 2023 21:15:45 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267616 Archived-At: On Wed, Aug 16 2023, Mattias Engdeg=C3=A5rd wrote: >> +;; The time when the compilation started. >> +(defvar compilation--start-time nil) > > What about using defvar-local? Then... > >> + (setq-local compilation--start-time (current-time)) > > can use plain setq. Seems to be a matter of taste. I don't know what the Official Style Guide says about it. > And if you use (float-time) here, then...=20 > >> + (let* ((secs (float-time (time-since compilation--start-time)))) > > ...this becomes a simple subtraction: (- (float-time) compilation--start-= time) > But then we couldn't use bignums. And representing time values as a pair of bignums is cool. So cool that it was worth to require libgmp for Emacs. Oh wait, current-time still doesn't use bignums. But when it switches, it will be sooo cool. Anyway, ERT uses current-time for ert--stats-start-time and I followed that example. >> + (cond ((< secs 1) (format "%.0fms" (* secs 1000))) >> + ((< secs 10) (format "%.2fs" secs)) >> + ((< secs 60) (format "%.1fs" secs)) >> + (t (format-seconds "%hh%mm%z%ss" secs))))) > > First of all, proper style is to separate the number and unit by a space. > The 'ms' case isn't very important -- 745 ms is no more readable than > 0.745 s, probably less so. > The last case is also less than readable. Something like 3:45:58 would > be better. Seems to be a matter of taste. I copied the style used by Go's Duration type: https://pkg.go.dev/time#Duration.String > The reader would also like to know what this new time indication > means. What about > > ..., duration 34.5 s > > or > > ..., 34.5 s elapsed > > ? Seems to be a matter of taste. ERT prints it like Ran 10 tests, 10 results as expected, 0 unexpected (2023-08-17 00:29:48+020= 0, 0.813428 sec)=20 and nobody seems to complain. Helmut