If I call (sleep .1) in the main listener, it sleeps for
the correct amount of time. If I call it from a separate
process, it sleeps for a second. Nothing else is running.
Any explanations for this?
- Bob
================================================
(defun sec-time ()
(format nil "~a seconds" (/ (get-internal-real-time)
(float internal-time-units-per-second))))
(defun test-proc0 (sleep-dur)
(mp:make-process (lambda () (loop repeat 10 do
(sleep sleep-dur)
(format t "~%Process ~a. Time ~a"
(mp:current-process)
(sec-time))))))
;;; ================================================
;;; Run in separate process. Slow.
;;; ================================================
* (test-proc0 .1)
#<Process Anonymous {491A107D}>
*
Process #<Process Anonymous {491A107D}>. Time 14242.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14243.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14244.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14245.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14246.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14247.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14248.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14249.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14250.48 seconds
Process #<Process Anonymous {491A107D}>. Time 14251.48 seconds
;;; ================================================
;;; Run in main listener. runs fast
;;; ================================================
(defun test-proc1 (sleep-dur)
(loop repeat 10 do
(sleep sleep-dur)
(format t "~%Process ~a. Time ~a"
(mp:current-process) (sec-time))))
(test-proc1 .1)
Process #<Process Initial {48003B35}>. Time 14273.29 seconds
Process #<Process Initial {48003B35}>. Time 14273.39 seconds
Process #<Process Initial {48003B35}>. Time 14273.49 seconds
Process #<Process Initial {48003B35}>. Time 14273.59 seconds
Process #<Process Initial {48003B35}>. Time 14273.69 seconds
Process #<Process Initial {48003B35}>. Time 14273.79 seconds
Process #<Process Initial {48003B35}>. Time 14273.89 seconds
Process #<Process Initial {48003B35}>. Time 14273.99 seconds
Process #<Process Initial {48003B35}>. Time 14274.09 seconds
Process #<Process Initial {48003B35}>. Time 14274.19 seconds