emacs-devel
[Top][All Lists]
Advanced

[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: Robin Tarsiger
Subject: Re: Function to make a struct timespec from a floating point number?
Date: Thu, 20 Jan 2022 12:31:08 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

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.

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.

I spy a ‘dtotimespec’ in lib/dtotimespec.c. Is that what you wanted?

Thanks.

In case it's useful to you in the future, I obtained that by a fairly
simple search across the C files for the expected return type at bol.
I used ‘less’ at the command line, but ‘dired-do-find-regexp’ would
have offered something similar. There are not many functions nor global
variables with a ‘struct timespec’ type.

-RTT



reply via email to

[Prev in Thread] Current Thread [Next in Thread]