[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/02: SRFI-19 current-time-monotonic returns time of ri
From: |
Andy Wingo |
Subject: |
[Guile-commits] 02/02: SRFI-19 current-time-monotonic returns time of right type |
Date: |
Wed, 19 Apr 2017 09:10:22 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit b11e2922c36c4105797c269c7e616535b702698a
Author: Andy Wingo <address@hidden>
Date: Wed Apr 19 15:08:46 2017 +0200
SRFI-19 current-time-monotonic returns time of right type
* module/srfi/srfi-19.scm (current-time-monotonic): Actually return a
time with the correct type. Fixes #26329.
---
module/srfi/srfi-19.scm | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/module/srfi/srfi-19.scm b/module/srfi/srfi-19.scm
index 658ccd9..795ad50 100644
--- a/module/srfi/srfi-19.scm
+++ b/module/srfi/srfi-19.scm
@@ -1,6 +1,6 @@
;;; srfi-19.scm --- Time/Date Library
-;; Copyright (C) 2001-2003, 2005-2011, 2014, 2016
+;; Copyright (C) 2001-2003, 2005-2011, 2014, 2016-2017
;; Free Software Foundation, Inc.
;;
;; This library is free software; you can redistribute it and/or
@@ -333,8 +333,11 @@
;; of course.
(define (current-time-monotonic)
- ;; Resolution is microseconds.
- (current-time-tai))
+ ;; Guile monotonic and TAI times are the same.
+ (let ((tai (current-time-tai)))
+ (make-time time-monotonic
+ (time-second tai)
+ (time-nanosecond tai))))
(define (current-time-thread)
(time-error 'current-time 'unsupported-clock-type 'time-thread))