From: ueno Date: Sun, 7 Oct 2001 05:44:03 +0000 (+0000) Subject: * liece-misc.el (liece-subtract-time): New function. X-Git-Tag: liece-1_4_7~22 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beabb71e249c36d59f0b45eccfa8b926f4148f68;p=elisp%2Fliece.git * liece-misc.el (liece-subtract-time): New function. (liece-time-difference): Use it. --- diff --git a/lisp/liece-misc.el b/lisp/liece-misc.el index 51830c2..e479e43 100644 --- a/lisp/liece-misc.el +++ b/lisp/liece-misc.el @@ -432,12 +432,17 @@ found)) ;;; stolen (and renamed) from time-date.el. -(defun liece-time-difference (t1 t2) +(defun liece-subtract-time (t1 t2) "Subtract two internal times." (let ((borrow (< (cadr t1) (cadr t2)))) (list (- (car t1) (car t2) (if borrow 1 0)) (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))) +(defun liece-time-difference (t1 t2) + "Return the differnce between two internal times in seconds." + (let ((sub (liece-subtract-time t1 t2))) + (+ (* (car sub) 65536) (cadr sub)))) + (defun liece-time-elapsed (time seconds) "Add SECONDS to TIME." (list (+ (car time) (/ (+ (cadr time) seconds) 65536))