From nobody Mon Nov 02 13:48:36 2026 X-Original-To: java@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jJCj02rNKz6yNrW for ; Mon, 02 Nov 2026 13:48:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jJCj00F3Gz4HMr for ; Mon, 02 Nov 2026 13:48:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793627316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A+Td0rUadJji7w+HMfB3BBAMGEsPzGr2QgOyIHPKGAA=; b=HYTB3/qrLJyW0DW9jqOeySM/Xr9tU7x8KSCLlvPG9qicqTTHf+zbPJA6bua2xy14KcMubF tr6bdX/9VUPb4lK1Q3jRagnDRwdJxByeXn2cqIc3A4CV6Bb4QiW4ChMhlmG1+SIuNLSO+f 9qYwJLNzm6Q/gXweYKxlJt6mQ006EhtcKMN0EiJvPMX9DOy+dfcJaInBRUOMlkpSOxgE7P qEtBju2MhCMbjo7rfoMywG2U2hxwyGXG7hzzzMNpJjM3IsXH/2nDynsaZkiEZCH9YhtmeB t9YoXGd3sJMHOHjOruXTq6sj21AmyglTGPRObkvvn59begbIPIcGY5O9+GrRIw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793627316; b=tuwclPCfpzfqqSZXRbCWymbuUXo8Ku8ebL3wunXgajzCIQdBDA7BgnNvzWxV+65c0WKD/P HTPoS/1OvDv9BXSjEHJkuLSPO+pOuY0AnbWAl+y/Odh8LCTqHXxKkhI7nsw52m50utDtuq 6QoXcNe5FENTOYiBY8f9pQGZFeHlpU5ViktUsph+9IwSNc5g4UDq7KdPbfKMBllrskfIdS obgtGZcbMUbbz77S3lplrSEV1hPxeyOG7pasTOEjI7h0FHey2/uDMUO6v6hkVy71lEBSaJ ABDNeALq8kEnr2OZ3NOCLS1kYVcpWvtQCqyF36RQT8Sx6kPZ4UEOUD7dzhDwCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793627316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A+Td0rUadJji7w+HMfB3BBAMGEsPzGr2QgOyIHPKGAA=; b=cy/dfYK+eU238W6Nu0AbrOLcBbeLBcJnkAVDvdJWQq+5pBV2MV1zqUov2SQJGtVyO4hULD BAGi6pbRY3Cvhbc1yS+sA7xoC4gMStpMgixUbuDPqM6TCzfik082K2bvGlBZLk/uWkmQya T/8LMG8xLHchKZqi6++AOoM0m4N2lRPjsk3GxIeJHSqAB/elZi7WI72VtkO8pLYRHQ1Us8 1mTbxzZnN+/QLnB7ArooNGfCH+RnRa+DGx1L6GDPnb4bzMnUF12py31foWWZHcrL7vSsKY W/GBLvFcNsGIReM9dlfOhFqdEGRIUCOQYCe6v3/zm5NYtfOieC/Fm0LWJCSm2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4jJChz6mJzzpSR for ; Mon, 02 Nov 2026 13:48:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 6A2DmZFn072906 for ; Mon, 2 Nov 2026 13:48:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6A2DmZCl072905 for java@FreeBSD.org; Mon, 2 Nov 2026 13:48:35 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: java@FreeBSD.org Subject: [Bug 300333] java/openjdk25: getCurrentThreadCpuTime() does not return the actual time in nanoseconds Date: Mon, 02 Nov 2026 13:48:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: haraldei@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Archive: https://lists.freebsd.org/archives/freebsd-java Sender: owner-freebsd-java@FreeBSD.org List-Id: Porting Java to FreeBSD List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D300333 --- Comment #2 from Harald Eilertsen --- I think the JVM code is correct. It uses the `clock_gettime(2)` call which = (at least on my test system) reports a resolution of 41ns. Which means if the l= oop runs faster than 41ns it will result in a delta of 0. I get comparable results with a small C++ test program running the same tes= t. I'll attach it here for reference. Adding a small delay to the loop to slow it down a bit gives more accurate results. Also note that while `ThreadMXBean.getCurrentThreadCpuTime()` returns a res= ult with nanosecond resolution, it does not guarantee nanosecond accuracy. --=20 You are receiving this mail because: You are on the CC list for the bug.=