[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: point-at-final-line

From: Emanuel Berg
Subject: Re: point-at-final-line
Date: Sat, 27 Jan 2018 04:02:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Seems to be virtually no difference
in performance.

So I'll go with the best-looking code, which is

Unless there are new facts to the case brought
to the courts attention...

(defmacro measure-time (&rest body)
  "Measure and return the running time of the code block.
Not mine:";
  (declare (indent defun))
  (let ((start (make-symbol "start")))
    `(let ((,start (float-time)))
       (- (float-time) ,start))))

(defun point-at-final-line ()
  (= (line-number-at-pos)
     (line-number-at-pos (point-max)) ))
;; (insert (format "\n;; %f" (measure-time #'point-at-final-line)))
;; 0.000005

(defun point-at-final-line-2 ()
    (= 1 (forward-line 1)) ))
;; (insert (format "\n;; %f" (measure-time #'point-at-final-line-2)))
;; 0.000006

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]