From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9283 invoked from network); 30 Apr 2021 10:26:18 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Apr 2021 10:26:18 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619778378; b=GyvAmzTFD1Uiy2bpwXufVXsg+p1iz3Aw42cQ6paKMcrxlhIn79gveOVlo1w8bV2Jb1CtkpvSFF KRsSxzQG2qZ+YfTyOavheiKmV20NqKP9vlQBR23v0EsDWOlcBd4VdsNvGICXUKJqwfi1PK1Xx5 JeKnmlrnVD0pqFzYQO8aK99JG3F1oSqq6bL0We5pXzeTuKhwAF0CZaaFFuPOfb3PvKYH546yzy sFb/+KYXMuPHQaSCzd9K1BAvTiVYG6vDD2ylrRrZBr/5koUqkaB8fsFc1D2A3iG9kS/DstPlay YXK2QzHgEWo8RehkyHxNwQRGX7iw0Uu8741aBttIaWd/bg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619778378; bh=QtJXR0v3zxrwr6umENkM1NrbgGCj2wkYSMJAkyVphKw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=rNYjzUarPxcn0frhoZ/inYn4NxNYrCdxoZjy9/WQhr8w62zLfts8BZZsVFbXTi61HRE/iYEHTo paFK3J8nqKBcS3gWrI6ZCaQeYbhfM+zs9CLjRvUQFZ2mKsE2eRPuWDoVBLz7iUOinirClDZ12t pcRtWvq7zDjArvJ5UNM49XDEMzHA868+L0FPzXQcZG13LCq7PZzsDVHv7uieyIOtR0ldZsZeqc wluSrjwV1BKTrhKi1iecXVMxUMnTxMgwF5GcVjrb6H2xVL048tofkKmXWAKralqy47XvmgzDNk YZODLF+SMxxb6mWKkTPF0SlQ0N+go4kZnr/xTY6b36kzIQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=avG/VTx8GwFuF1wE1IkfvDY52yhoWqSwI0UC9cAWVlw=; b=efCFRKvktluqklNQUk8PXJIWvc RhYlRqLxAzrseuRAbcyVBixGrd4J1I/fO0cmHZvAnMQlLNRTE1RFtC7SCchWJ6/xISi21B/GrUUTf eAAm4VvDfYO72Y9BkWUZUiTBHJwDQ42gxHHdBdeRyh1Fb2C6uDiCYZAoRRZ7nhHv7u4PVBxpF60VW Kc5iK5oEpRUxaksZFV6SAibazYyRrSjoz6hHOT69WSKpxR94bz9tw1bsoPdyJdvzGbkbAG8MhDuxU PjE0BVQMuJpePdxyQTESq3hr73E4dvpIWtG0LxwPnDKbPUsAbDkYVxZR5492ru7+mXBXbsPHZYFVK aC08Nnhw==; Received: from authenticated user by zero.zsh.org with local id 1lcQLh-000HlT-FU; Fri, 30 Apr 2021 10:26:17 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:55938) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lcQLQ-000HY3-LJ; Fri, 30 Apr 2021 10:26:00 +0000 Received: from smtp-zira.vinc17.net (unknown [IPv6:2a01:cb19:869c:7700:6150:861a:e24c:595d]) by joooj.vinc17.net (Postfix) with ESMTPSA id 487C9DE; Fri, 30 Apr 2021 12:26:00 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 9731CC22E23; Fri, 30 Apr 2021 12:25:58 +0200 (CEST) Date: Fri, 30 Apr 2021 12:25:58 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: miscomputation of total time? Message-ID: <20210430102558.GA1183927@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20210430095057.GA1181586@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210430095057.GA1181586@zira.vinc17.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.0.6+169 (acb2bdd4) vl-137001 (2021-04-28) X-Seq: 48751 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2021-04-30 11:50:57 +0200, Vincent Lefevre wrote: > I use REPORTTIME=60, and on a Debian 10 machine (I haven't tried on > others) with zsh 5.7.1, I've noticed that the fraction of second in > the total time (the 2 digits between the period and " total") is not > random as expected: on the 370 runs in the past few months, I get a > value always between 17 and 99. Moreover, values from 17 to 47 occur > much more often than values from 48 to 99 (325 values vs 45). > Statistically, these values should be random between 00 and 99. > > Is there an error in the computation of the total time? Sorry, I think that I found the cause. I forgot that the process in question was multithreaded, with a main thread waiting for the others (even on this machine with 1 core). A check is done every second with a "sleep 1", so that I think that the total time is an integer number of seconds + some overhead. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)