+(defun split-seconds-for-sleep (seconds)
+ (declare (optimize speed))
+ (flet ((split-float ()
+ ;; KLUDGE: This whole thing to avoid consing floats
+ (let ((whole-seconds (truly-the fixnum (%unary-truncate seconds))))
+ (values whole-seconds
+ (truly-the fixnum
+ (%unary-truncate (* (- seconds whole-seconds)
+ (load-time-value 1s9 t))))))))
+ (declare (inline split-float))
+ (typecase seconds
+ ((single-float 0s0 #.(float most-positive-fixnum 1s0))
+ (split-float))
+ ((double-float 0d0 #.(float most-positive-fixnum 1d0))
+ (split-float))
+ (ratio
+ (multiple-value-bind (quot rem) (truncate (numerator seconds)
+ (denominator seconds))
+ (values quot
+ (* rem (/ 1000000000 (denominator seconds))))))
+ (t
+ (multiple-value-bind (sec frac)
+ (truncate seconds)
+ (values sec (truncate frac (load-time-value 1s-9 t))))))))
+