diff --git a/toolkit.lisp b/toolkit.lisp index ae7757f9a..f2d522d4a 100644 --- a/toolkit.lisp +++ b/toolkit.lisp @@ -109,22 +109,14 @@ (dolist (sub (c2mop:class-direct-subclasses class)) (apply-class-changes sub))) -#+sbcl -(define-symbol-macro current-time-start - (load-time-value (logand (sb-ext:get-time-of-day) (1- (expt 2 32))))) - (declaim (inline current-time)) (defun current-time () (declare (optimize speed (safety 0))) - #+sbcl (multiple-value-bind (s ms) (sb-ext:get-time-of-day) - (let* ((s (logand s (1- (expt 2 62)))) - (ms (logand ms (1- (expt 2 62))))) - (declare (type (unsigned-byte 62) s ms)) - (+ (- s current-time-start) - (* ms - (coerce 1/1000000 'double-float))))) - #-sbcl (* (get-internal-real-time) - (coerce (/ internal-time-units-per-second) 'double-float))) + (multiple-value-bind (s ms) (org.shirakumo.precise-time:get-monotonic-time) + (let* ((s (logand s (1- (expt 2 62)))) + (ms (logand ms (1- (expt 2 62))))) + (declare (type (unsigned-byte 62) s ms)) + (+ s (* ms (load-time-value (coerce (/ org.shirakumo.precise-time:MONOTONIC-TIME-UNITS-PER-SECOND) 'double-float))))))) (defmacro undefmethod (name &rest args) (flet ((lambda-keyword-p (symbol) diff --git a/trial.asd b/trial.asd index 5fc12d170..622af9158 100644 --- a/trial.asd +++ b/trial.asd @@ -198,6 +198,7 @@ :mmap :nibbles :pathname-utils + :precise-time :promise :quickhull :random-sampling