From ee6f1be04b41b6cf530cfb34a5b30f0c0649f5b0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 30 Jun 2011 18:52:41 -0700 Subject: [PATCH] * 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. --- lisp/ChangeLog | 4 ++++ lisp/nxml/rng-maint.el | 8 +------- 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 @@ 2011-07-01 Paul Eggert + * 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): 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 @@ ;;; 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 () -- 2.39.2