[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function to make a struct timespec from a floating point number?
From: |
Eli Zaretskii |
Subject: |
Re: Function to make a struct timespec from a floating point number? |
Date: |
Thu, 20 Jan 2022 19:45:36 +0200 |
> From: Po Lu <luangruo@yahoo.com>
> Date: Thu, 20 Jan 2022 20:44:01 +0800
>
> I recall there being a function in the Emacs sources to construct a
> `struct timespec' from a floating point number denoting seconds.
>
> 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.
>
> Does anyone remember the name of that function, if it does exist? I
> don't want to reinvent the wheel.
Is dtotimespec what you want? It's a Gnulib function, we use it in
process.c.