summaryrefslogtreecommitdiff
path: root/time.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'time.lisp')
-rw-r--r--time.lisp14
1 files changed, 7 insertions, 7 deletions
diff --git a/time.lisp b/time.lisp
index 3d0f2bb..009e9a5 100644
--- a/time.lisp
+++ b/time.lisp
@@ -1,9 +1,9 @@
-;; Makes a-list with '((hours . HOURS) (minutes . MINUTES) (seconds . SECONDS) (ms . MILLISECONDS))
-(defun make-time-alist (ms)
- `((hours . ,(floor (/ ms (* 1000 60 60))))
- (minutes . ,(floor (mod (/ ms (* 1000 60)) 60)))
- (seconds . ,(floor (mod (/ ms 1000) 60)))
- (ms . ,(mod ms 1000))))
+;; Makes a-list with '((hours . HOURS) (minutes . MINUTES) (seconds . SECONDS) (cs . CENTISECONDS))
+(defun make-time-alist (cs)
+ `((hours . ,(floor (/ cs (* 100 60 60))))
+ (minutes . ,(floor (mod (/ cs (* 100 60)) 60)))
+ (seconds . ,(floor (mod (/ cs 100) 60)))
+ (cs . ,(mod cs 100))))
;; Formats, disregarding min/hour if they shouldn't be shown, a time alist to "H:M:S.ms"
(defun format-time (time-alist)
@@ -11,7 +11,7 @@
((hours (cdr (assoc 'hours time-alist)))
(minutes (cdr (assoc 'minutes time-alist)))
(seconds (cdr (assoc 'seconds time-alist)))
- (centis (round (/ (cdr (assoc 'ms time-alist)) 10))))
+ (centis (cdr (assoc 'cs time-alist))))
(concatenate 'string
(unless (zerop hours) (format nil "~2,'0d:" hours))
(unless (and (zerop minutes) (zerop hours)) (format nil "~2,'0d:" minutes))