From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: Function to make a struct timespec from a floating point number? Date: Thu, 20 Jan 2022 19:21:26 +0100 Message-ID: References: <87czkm1sry.fsf.ref@yahoo.com> <87czkm1sry.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1RnQUUWTn7iAXeoj" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31530"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 20 22:55:53 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nAfPN-0007yf-9y for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jan 2022 22:55:53 +0100 Original-Received: from localhost ([::1]:59426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAfPL-0002ho-Gy for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jan 2022 16:55:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAc3w-0000Ma-Oe for emacs-devel@gnu.org; Thu, 20 Jan 2022 13:21:32 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:51170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAc3u-0002KN-Ec for emacs-devel@gnu.org; Thu, 20 Jan 2022 13:21:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dS0QqsE6UAoIqDs2AxcQd/MKzn6fV2Oy9ZqLNICa6y8=; b=TxC6gvwG1D5OqS+1bpueRbDK1n 1SCZt/t6Q+88cTeQJBHE59v88UPrqHbhz2m2jF99klMjwET4lYCBriNrGQfsH/QZqLvrU/ITCAsCv F6h4RAeoc4FK5oHNfQ07iWUXQTiB8u9EPQnTV1l1e3o+W5Hfh0/2LktuKUWKsWGyaly/wQX/T8VWd 9SbxcqxZvo0SAXmE7iee2CsgZMhBNAiREh+rLA8bA/EPLMYdQzRdkkzG/heXKJ6c933qWX63HX5ns XEG0fwgMYB3wL5vflmTUoeAa7n6uMT73Eejr5//6nY7IppCVSDG56d6uhi0Hkl9/8GZd9cvhaqaaW X3/hRP+g==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1nAc3q-0004pH-TI for emacs-devel@gnu.org; Thu, 20 Jan 2022 19:21:26 +0100 Content-Disposition: inline In-Reply-To: <87czkm1sry.fsf@yahoo.com> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:285056 Archived-At: --1RnQUUWTn7iAXeoj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 20, 2022 at 08:44:01PM +0800, Po Lu wrote: > I recall there being a function in the Emacs sources to construct a > `struct timespec' from a floating point number denoting seconds. That might be `time-convert': (let* ((tim0 (current-time)) (ftim (float-time tim0)) (tim1 (time-convert ftim))) (message "tim0: %S ftim: %S tim1: %S\n" tim0 ftim tim1)) =3D> tim0: (25065 42935 269749 160000) ftim: 1642702775.2697492 tim1: (25= 065 42935 269749 164581) (some stuff in the lower bits seems to get lost in translation, alas :) > I would like to use it to allow setting `polling-period' to a period > less than one second, so that C-g can be detected faster in the NS port. >=20 > Does anyone remember the name of that function, if it does exist? I > don't want to reinvent the wheel. HTH --=20 t --1RnQUUWTn7iAXeoj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCYemoIAAKCRAFyCz1etHa RsdNAJ0c0Sdt5MVkr3DB9xEwoGhwDxyjGACdHc7ldVrRzi6FCPr6vzWqGr539wM= =PKA+ -----END PGP SIGNATURE----- --1RnQUUWTn7iAXeoj--