This yields a more-accurate answer.
(rng-time-to-float): Remove; no longer needed.
2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
+ * 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.
+
* emacs-lisp/timer.el (timer-relative-time): Use time-add.
* calendar/timeclock.el (timeclock-seconds-to-time):
;;; Timing
-(defun rng-time-to-float (time)
- (+ (* (nth 0 time) 65536.0)
- (nth 1 time)
- (/ (nth 2 time) 1000000.0)))
-
(defun rng-time-function (function &rest args)
(let* ((start (current-time))
(val (apply function args))
(end (current-time)))
(message "%s ran in %g seconds"
function
- (- (rng-time-to-float end)
- (rng-time-to-float start)))
+ (float-time (time-subtract end start)))
val))
(defun rng-time-tokenize-buffer ()