;;;; (module current-microseconds (;export current-microseconds) (import scheme (chicken base) (chicken type) (chicken foreign)) (: get-microsecs (-> float)) (cond-expand (macosx (include "macosx") ) ((or mingw32 cygwin) (include "windows") ) (unix ;(or netbsd openbsd freebsd linux) (include "unix") ) (else (error "unsupported platform") ) ) (cond-expand (reliable-time (define (current-microseconds) (inexact->exact (floor (get-microsecs)))) ) (else (define (current-microseconds) (let ((μs (inexact->exact (floor (get-microsecs))))) (when (negative? μs) (warning 'current-microseconds "cannot retrieve time reliably")) μs ) ) ) ) ) ;module current-microseconds