Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJxUY-007Zwj-6D for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2024 15:44:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sJxUU-001JTU-Tw for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2024 15:44:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJxUU-001JTM-Jp for pgsql-hackers@lists.postgresql.org; Wed, 19 Jun 2024 15:44:55 +0000 Received: from fhigh7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJxUP-002Ubw-7h for pgsql-hackers@postgresql.org; Wed, 19 Jun 2024 15:44:54 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 8F30011401F0; Wed, 19 Jun 2024 11:44:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 19 Jun 2024 11:44:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1718811887; x=1718898287; bh=d8q8VapPRV/CnYA/3fnCKwSgydKyreKp 025yyR9opBU=; b=Fj4XujfyY8mNJCIc1TwN8VkP4H/yLrU2K+GBe+lrw+TRhyvY rHL53kPLp++ZhDLYADNVdR0MfgryY+xGE6wiD8QxATCuD/L27w6Z0VqkXZehlh7G QGCs7AqJcE1pRplT1sgFFao1udmWaWgWNesg3gY/kUT5u3B956xUh1EnHwwi0boq aCsc1IeOAjdB7+pn2cQNNZKJXT3Tfob/TlPp/LGRRUyXU+nn3FcNoG2xG0ovsnNc 1BaniF/mhMDTAm5uQWLuERbRe7qxIoxRXxqxmvtSD0v3p5HNcKCRG8Kra7qyR6BT GP9M6NMoSj+tAYEhoviwXjiwIyu676ldsOyt/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1718811887; x= 1718898287; bh=d8q8VapPRV/CnYA/3fnCKwSgydKyreKp025yyR9opBU=; b=P weQdKNtQoCJXe5BFkV+A8mEjAb0Kc2i4NJm1KD/t/wEkEH73omQjs6e06M80E7bb oYi4ZZzobNhgFpNqIJ2zSDpKI1/2EaVbQKpOay8Y6u3/s0Klk+9tT3tpxiKXW/kz BHQb1qlUIGOKDzVwIC3uHQTcxDWi8SiiokS7cgyqFVbeT6kKmHBq+k6nOdQUI6Eo EE4/KvYeBeO5J35FIj71AC8ZJu1e8lUgZ6S1IMNv+S3lr/ZuHkULEG9CPjC5daB9 HnGv1HUpxfWed/bPHrJGxX1Alaox80VRaYZoxlD4D4azWk1XAlHJYmmTjBsL8gSs kNV7BhjqxA+1eywPi6ZzQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeftddgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh eqnecuggftrfgrthhtvghrnhepjefhveehtdetgfffhffhfeefgffghffflefgieeuueek hedvhedvfeehffdvfeeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jun 2024 11:44:46 -0400 (EDT) Message-ID: <9e7b21e7-4c63-4299-87f4-780a0699a7d8@eisentraut.org> Date: Wed, 19 Jun 2024 17:44:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: What is a typical precision of gettimeofday()? To: "Andrey M. Borodin" , Hannu Krosing Cc: pgsql-hackers References: <47AEACEE-E5CC-40E4-8611-01F3A465AF16@yandex-team.ru> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <47AEACEE-E5CC-40E4-8611-01F3A465AF16@yandex-team.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 18.06.24 07:47, Andrey M. Borodin wrote: > > >> On 19 Mar 2024, at 13:28, Peter Eisentraut wrote: >> >> I feel that we don't actually have any information about this portability concern. Does anyone know what precision we can expect from gettimeofday()? Can we expect the full microsecond precision usually? > > At PGConf.dev Hannu Krossing draw attention to pg_test_timing module. I’ve tried this module(slightly modified to measure nanoseconds) on some systems, and everywhere I found ~100ns resolution (95% of ticks fall into 64ns and 128ns buckets). AFAICT, pg_test_timing doesn't use gettimeofday(), so this doesn't really address the original question.