From: Paul Eggert Date: Fri, 1 Jul 2011 04:44:40 +0000 (-0700) Subject: * vc/ediff-util.el (ediff-calc-command-time): Use time-since X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~289 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ef923dcc3ed7f7f7824dce22f372e34ee26b687;p=emacs.git * vc/ediff-util.el (ediff-calc-command-time): Use time-since and float-time. Say "NNN.NNN seconds" rather than "NNN seconds + NNN microseconds". --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4b067b043ed..4bd6cd45671 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-07-01 Paul Eggert + * vc/ediff-util.el (ediff-calc-command-time): Use time-since + and float-time. Say "NNN.NNN seconds" rather than "NNN seconds + + NNN microseconds". + * type-break.el (type-break-time-sum): Rewrite using time-add. * play/hanoi.el (hanoi-current-time-float): Remove. diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 40ffea624fb..df6a7e938af 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -4144,15 +4144,9 @@ Mail anyway? (y or n) ") ;; calculate time used by command (defun ediff-calc-command-time () - (let ((end (current-time)) - micro sec) - (setq micro - (if (>= (nth 2 end) (nth 2 ediff-command-begin-time)) - (- (nth 2 end) (nth 2 ediff-command-begin-time)) - (+ (nth 2 end) (- 1000000 (nth 2 ediff-command-begin-time))))) - (setq sec (- (nth 1 end) (nth 1 ediff-command-begin-time))) - (or (equal ediff-command-begin-time '(0 0 0)) - (message "Elapsed time: %d second(s) + %d microsecond(s)" sec micro)))) + (or (equal ediff-command-begin-time '(0 0 0)) + (message "Elapsed time: %g second(s)" + (float-time (time-since ediff-command-begin-time))))) (defsubst ediff-save-time () (setq ediff-command-begin-time (current-time)))