unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#26329: monotonic time not supplied by current-time
@ 2017-04-01 11:18 Zefram
  2017-04-19 13:10 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Zefram @ 2017-04-01 11:18 UTC (permalink / raw)
  To: 26329

The SRFI-19 current-time function can return several flavours of the
current time:

scheme@(guile-user)> (use-modules (srfi srfi-19))
scheme@(guile-user)> (current-time time-utc)
$1 = #<time type: time-utc nanosecond: 727666000 second: 1491045256>
scheme@(guile-user)> (current-time time-tai)
$2 = #<time type: time-tai nanosecond: 414752000 second: 1491045294>
scheme@(guile-user)> (current-time time-monotonic)
$3 = #<time type: time-tai nanosecond: 814494000 second: 1491045297>

The last of these three is erroneous: a time structure of type
time-monotonic was requested and must be returned, but instead the
type is time-tai.  Although the implementation gives these two time
types numerically identical behaviour, it does treat them as nominally
distinct in other operations:

scheme@(guile-user)> (eqv? time-tai time-monotonic)
$4 = #f
scheme@(guile-user)> (julian-day->time-tai 2450000)
$5 = #<time type: time-tai nanosecond: 0 second: 813240029>
scheme@(guile-user)> (julian-day->time-monotonic 2450000)
$6 = #<time type: time-monotonic nanosecond: 0 second: 813240029>

-zefram





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#26329: monotonic time not supplied by current-time
  2017-04-01 11:18 bug#26329: monotonic time not supplied by current-time Zefram
@ 2017-04-19 13:10 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2017-04-19 13:10 UTC (permalink / raw)
  To: Zefram; +Cc: 26329-done

On Sat 01 Apr 2017 13:18, Zefram <zefram@fysh.org> writes:

> The SRFI-19 current-time function can return several flavours of the
> current time:
>
> scheme@(guile-user)> (use-modules (srfi srfi-19))
> scheme@(guile-user)> (current-time time-utc)
> $1 = #<time type: time-utc nanosecond: 727666000 second: 1491045256>
> scheme@(guile-user)> (current-time time-tai)
> $2 = #<time type: time-tai nanosecond: 414752000 second: 1491045294>
> scheme@(guile-user)> (current-time time-monotonic)
> $3 = #<time type: time-tai nanosecond: 814494000 second: 1491045297>
>
> The last of these three is erroneous: a time structure of type
> time-monotonic was requested and must be returned, but instead the
> type is time-tai.

Thanks for the report; fixed.  Patches welcome too.

Andy





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-19 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01 11:18 bug#26329: monotonic time not supplied by current-time Zefram
2017-04-19 13:10 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).