(defun foo () (interactive) (while (not (eobp)) (c-end-of-defun))) (defun bar () (interactive) (while (not (bobp)) (c-beginning-of-defun))) (defun bench () (find-file "xdisp.c") (goto-char (point-min)) (let* ((t1 (current-time)) (t2 (progn (foo) (current-time))) (t3 (progn (bar) (current-time)))) (cons (float-time (time-subtract t2 t1)) (float-time (time-subtract t3 t2)))))