[Top][All Lists]

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

Re: point-at-final-line

From: Stefan Monnier
Subject: Re: point-at-final-line
Date: Mon, 29 Jan 2018 22:50:09 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> (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)))
>        ,@body
>        (- (float-time) ,start))))
> ;; (insert (format "\n;; %f" (measure-time #'point-at-final-line)))

This doesn't actually call the function, so no wonder it will take the
same amount of time no matter which function you pass to it.


reply via email to

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