aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-06-30 18:52:41 -0700
committerPaul Eggert2011-06-30 18:52:41 -0700
commitee6f1be04b41b6cf530cfb34a5b30f0c0649f5b0 (patch)
treecf82a48d7d1b5f84e3f7c79433f85675afd9f829
parent240a298f78ab504afcf0792e3061be9b95c8c581 (diff)
downloademacs-ee6f1be04b41b6cf530cfb34a5b30f0c0649f5b0.tar.gz
emacs-ee6f1be04b41b6cf530cfb34a5b30f0c0649f5b0.zip
* nxml/rng-maint.el (rng-time-function): Rewrite using time-subtract.
This yields a more-accurate answer. (rng-time-to-float): Remove; no longer needed.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/nxml/rng-maint.el8
2 files changed, 5 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3751cea4287..6175def190f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12011-07-01 Paul Eggert <eggert@cs.ucla.edu> 12011-07-01 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * nxml/rng-maint.el (rng-time-function): Rewrite using time-subtract.
4 This yields a more-accurate answer.
5 (rng-time-to-float): Remove; no longer needed.
6
3 * emacs-lisp/timer.el (timer-relative-time): Use time-add. 7 * emacs-lisp/timer.el (timer-relative-time): Use time-add.
4 8
5 * calendar/timeclock.el (timeclock-seconds-to-time): 9 * calendar/timeclock.el (timeclock-seconds-to-time):
diff --git a/lisp/nxml/rng-maint.el b/lisp/nxml/rng-maint.el
index d31740f0ca2..bd5b3136d54 100644
--- a/lisp/nxml/rng-maint.el
+++ b/lisp/nxml/rng-maint.el
@@ -224,19 +224,13 @@
224 224
225;;; Timing 225;;; Timing
226 226
227(defun rng-time-to-float (time)
228 (+ (* (nth 0 time) 65536.0)
229 (nth 1 time)
230 (/ (nth 2 time) 1000000.0)))
231
232(defun rng-time-function (function &rest args) 227(defun rng-time-function (function &rest args)
233 (let* ((start (current-time)) 228 (let* ((start (current-time))
234 (val (apply function args)) 229 (val (apply function args))
235 (end (current-time))) 230 (end (current-time)))
236 (message "%s ran in %g seconds" 231 (message "%s ran in %g seconds"
237 function 232 function
238 (- (rng-time-to-float end) 233 (float-time (time-subtract end start)))
239 (rng-time-to-float start)))
240 val)) 234 val))
241 235
242(defun rng-time-tokenize-buffer () 236(defun rng-time-tokenize-buffer ()