fix bug related to GET-INTERNAL-REAL-TIME, which in ECL is now micro-seconds (was: milli-seconds)

This commit is contained in:
pls.153 2024-03-26 19:57:04 +01:00
parent cc96a2c2df
commit d17fea07d8
3 changed files with 3 additions and 3 deletions

View file

@ -35,7 +35,7 @@
(defun filter (lat lon accuracy speed)
(when (and lat lon accuracy speed)
(setf accuracy (max 1 accuracy))
(let ((timestamp (get-internal-real-time)))
(let ((timestamp (/ (get-internal-real-time) 1000.0)))
(if *variance*
(let ((time-inc (- timestamp *timestamp*)))
(incf *variance* (/ (* time-inc (expt speed 2)) 1000))

View file

@ -8,7 +8,7 @@
"After *DISTANCE-SAMPLES* samples, calculate average speed and update on
every new distance sample."
(push (cons (distance)
(get-internal-real-time))
(/ (get-internal-real-time) 1000.0))
samples)
(when (> (length samples) *distance-samples*)
(setf samples (butlast samples))