;;;; (module current-microseconds (;export current-flmicroseconds current-microseconds) (import scheme (chicken base) (chicken type) (chicken flonum) (chicken foreign)) (: current-flmicroseconds (-> float)) (: current-microseconds (-> integer)) (: get-microsecs (-> float)) (cond-expand (windows (include "windows") ) (unix (include "unix") ) (else (error "unsupported platform") ) ) (cond-expand (reliable-time (define current-flmicroseconds get-microsecs) ) (else (define (current-flmicroseconds) (let ((μs (get-microsecs))) (when (negative? μs) (warning 'current-microseconds "cannot retrieve time reliably")) μs ) ) ) ) (define (current-microseconds) (inexact->exact (fpfloor (current-flmicroseconds)))) ) ;module current-microseconds