From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA5FDC433E7 for ; Sun, 18 Oct 2020 13:09:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 95D2821655 for ; Sun, 18 Oct 2020 13:09:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C/5ulm54" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbgJRNJW (ORCPT ); Sun, 18 Oct 2020 09:09:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbgJRNJV (ORCPT ); Sun, 18 Oct 2020 09:09:21 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95104C061755 for ; Sun, 18 Oct 2020 06:09:21 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id q5so10070443wmq.0 for ; Sun, 18 Oct 2020 06:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=F5n+8TP73RPv4xPOWs2aopDNKSCsvENL2ALIGM5VyAQ=; b=C/5ulm54XUQytHx/yjx5Q5KZFNhYVFLbkS0ZJom5uxluSE+ELfQKvjXD72jpx73IVN aPcXFCwYJMLaVkIMAIQhfh/8kjjnahwfb0E4iCvncaaBOE3d9AY+54XdixQx164Z38ag EDq0lgWpEL9pIyStA6rZSBxRA+qnr0JAmL9V0chdt6yk25+MefC2GOlbU9lkhpZmefKU l6wLBS53RdIUjfo/DCwjrTf9loFYDA7e8QMRqQd353hf5Dwcuxhkl+2mEeBbhZG7dNMX TMO/rSGqt3ENiGirFlvowz2lCUsUTSEBk/rmcrResXgJD9vhlmGpO4S8NG2WpgTR+AO6 7JbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F5n+8TP73RPv4xPOWs2aopDNKSCsvENL2ALIGM5VyAQ=; b=qGoALTzeVjuljSCwVrKfIbNY2dRPfrBMShiQjaPALj2KvEnQqag0j59d1gC0H7dVqB ItZRfCq7lb2Q6WZfDhQpmt4ozfCICr0+7niXpuET+lZ6K7OWogiSE0BoadiUiu927ylh 5kva//z9JIHzPSdz85qhwZ21P7bJZV9Fz5/x38iTUrG0iCyTuChf/2wpnmesjYRskFFR d3bN3QkkqSBChMhTKLZspGBwfkwr7KvG01HnWP1Sk7dH5u+X9pMGXPPF+U/x65dO12DR A9a9lIhPfPAeWmwDzn5KbJaTF4gEAwa+dYE0mLDFnzZuJ8sXPYJtYKPCrAWY3R4MAUg9 IqeA== X-Gm-Message-State: AOAM531XoIs1rlWmrfTypOE2Gq1JSV02T3czGC1m7VSm/kFvtGHeMk+6 k7WL6B07CpDqfFlvWh/YrHmSO1Qg4H0= X-Google-Smtp-Source: ABdhPJzVpwhJqwtGUx9kfcEwITbQXXTKsdq3OzGdOdQexFXXemQU4v+Nqv7VnDGqoHIty+ZUptBWUg== X-Received: by 2002:a1c:2d8f:: with SMTP id t137mr12665983wmt.26.1603026560177; Sun, 18 Oct 2020 06:09:20 -0700 (PDT) Received: from [192.168.1.10] (static-176-175-73-29.ftth.abo.bbox.fr. [176.175.73.29]) by smtp.gmail.com with ESMTPSA id c18sm13472383wrq.5.2020.10.18.06.09.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Oct 2020 06:09:19 -0700 (PDT) Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH 2/3] system_data_types.7: Add 'clock_t' To: Alejandro Colomar References: <20201017213758.9270-1-colomar.6.4.3@gmail.com> <20201017213758.9270-2-colomar.6.4.3@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: Date: Sun, 18 Oct 2020 15:09:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org Hello Alex, >> This type has a strange history. In my book, I note: >> >> Although the clock_t return type of clock() is the same >> data type that is used in the times() call, the units of >> measurement employed by these two interfaces are >> different. This is the result of historically conflicting >> definitions of clock_t in POSIX.1 and the C programming >> language standard. > > > Ahhh now I get it. So CLOCKS_PER_SEC doesn't mean CLOCK_TICKS_PER_SEC, > right? I always thought that it really was that, and clock() simply > returned clock ticks. But it looks like it returns an arbitrary > division of the second called CLOCKS_PER_SEC. More or less. But the standard also says (in the spec): The value of CLOCKS_PER_SEC shall be 1 million on XSI-conformant systems. (Yes, it is odd.) Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/