; Fix last change

* doc/lispref/os.texi (Time Calculations): Extend documentation of
'seconds-to-string'; add missing @end defun.  (Bug#71572)
This commit is contained in:
Eli Zaretskii 2024-12-21 12:30:44 +02:00
parent 308d5d5473
commit b6852b67b0

View file

@ -2205,10 +2205,26 @@ structure. For instance, the 120th day in 2004 is April 29th.
@end defun
@defun seconds-to-string delay &optional readable abbrev precision
Return a string describing a given @var{delay} (in seconds). Optional
arguments can be used to configure a human readable delay using various
formats. For example, a delay of 9861.5 seconds with @var{readable} set
to the symbol @code{expanded} returns @samp{2 hours 44 minutes}.
Return a string describing a given @var{delay} (in seconds). By
default, this function formats the returned string as a floating-point
number in units selected according to the value of @var{delay}. For
example, a delay of 9861.5 seconds yields @samp{2.74h}, since the value
of @var{delay} is longer than 1 hour, but shorter than 1 day. The
output formatting can be further controlled by the optional arguments,
if optional argument @var{readable} is non-@code{nil}. If
@var{readable}'s value is @code{expanded}, the returned string will
describe @var{delay} using two units; for example, a delay of 9861.5
seconds with @var{readable} set to the symbol @code{expanded} returns
@samp{2 hours 44 minutes}, but if @var{readable} is @code{t}, the
function returns @samp{3 hours}. Optional argument @var{abbrev}, if
non-@code{nil}, means to abbreviate the units: use @samp{h} instead of
@samp{hours}, @samp{m} instead of @samp{minutes}, etc. If
@var{precision} is a whole integer number, the function rounds the value
of the smallest unit it produces to that many digits after the decimal
point; thus, 9861.5 with @var{precision} set to 3 yields @samp{2.739
hours}. If @var{precision} is a non-negative float smaller than 1, the
function rounds to that value.
@end defun
@node Timers
@section Timers for Delayed Execution