[email protected] writes: > (define (jiffies-per-second) 1000000000) > (define (current-jiffy) > (with-let *libc* > (let ((res (clock_gettime CLOCK_MONOTONIC))) > (+ (* 1000000000 (cadr res)) (caddr res))))) > (define (current-second) (* 1.0 ((*libc* 'time) (c-pointer 0 > 'time_t*))))
I have not tried the code yet, but I have noticed that per POSIX, the CLOCK_MONOTONIC type measures since "some unspecified point in the past". On Linux, it measures the time since the last boot, for instance. If so, then even if the current-second correctly "ticks" once per second, the number returned from the `current-second' procedure would still deviate from the expected value, as per R7RS. As a result, any R7RS code that actually needs *correct* time would break. Rudy -- "Simplicity is complexity resolved." -- Constantin Brâncuși, 1876-1957 Rudolf Adamkovič <[email protected]> [he/him] Studenohorská 25 84103 Bratislava Slovakia _______________________________________________ Cmdist mailing list [email protected] https://cm-mail.stanford.edu/mailman/listinfo/cmdist
