Ignore:
Timestamp:
05/03/20 02:55:09 (12 months ago)
Author:
Kon Lovett
Message:

fix NS/MS & NS/MuS name, only unix ts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-19/trunk/srfi-19-tm.scm

    r38668 r38676  
    9292  tm:seconds->time-values
    9393  tm:seconds->time
    94   tm:current-time-values
    9594  tm:current-time-utc
    9695  tm:current-time-tai
     
    546545
    547546(define (tm:time->milliseconds tim)
    548   (+ (/ (%time-nanosecond tim) NS/MS) (* (%time-second tim) MS/S)) )
     547  (+ (/ (%time-nanosecond tim) MS/NS) (* (%time-second tim) MS/S)) )
    549548
    550549(define (tm:nanoseconds->seconds ns)
     
    564563          milliseconds microseconds nanoseconds)
    565564        (let (
    566           (nanos (+ (* milliseconds NS/MS) (* microseconds NS/MuS) nanoseconds))
     565          (nanos (+ (* milliseconds MS/NS) (* microseconds MuS/NS) nanoseconds))
    567566    (secs (+ (* days SEC/DY) (* hours SEC/HR) (* minutes SEC/MIN) seconds)) )
    568567    (let-values (
     
    580579    ((sec ms-sec) (quotient&remainder ms MS/S)) )
    581580    (let (
    582       (ns (* (number->integer ms-sec) NS/MS)) )
     581      (ns (* (number->integer ms-sec) MS/NS)) )
    583582      (values ns sec) ) ) )
    584583
     
    597596;; Current time routines
    598597
    599 (import (only srfi-19-tmctm tm:current-time-values))
     598(cond-expand
     599  (unix
     600    ;add back C_startup_time_seconds
     601    (define tm:current-time-values
     602      (let ((t0 (current-seconds)))
     603        (lambda ()
     604          (let-values (((s ms) (quotient&remainder (current-milliseconds) MS/S)))
     605            (values (* ms MS/NS) (+ t0 s)) ) ) ) ) )
     606  (else
     607    (define (tm:current-time-values)
     608      (values 0 (current-seconds)) ) ) )
    600609
    601610(define (tm:current-time-utc)
     
    627636
    628637(define (tm:time-resolution tt)
    629   NS/MS )
     638  MS/NS )
    630639
    631640;; Time Comparison
Note: See TracChangeset for help on using the changeset viewer.