From 0ef923dcc3ed7f7f7824dce22f372e34ee26b687 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 30 Jun 2011 21:44:40 -0700 Subject: [PATCH] * vc/ediff-util.el (ediff-calc-command-time): Use time-since and float-time. Say "NNN.NNN seconds" rather than "NNN seconds + NNN microseconds". --- lisp/ChangeLog | 4 ++++ lisp/vc/ediff-util.el | 12 +++--------- 2 files changed, 7 insertions(+), 9 deletions(-) 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))) -- 2.39.2