diff options
author | Tino Calancha <tino.calancha@gmail.com> | 2017-03-03 18:26:30 +0900 |
---|---|---|
committer | Tino Calancha <tino.calancha@gmail.com> | 2017-03-03 18:26:30 +0900 |
commit | 244de7b0ed3bb23e700c9edef51e413602d8720a (patch) | |
tree | c61679d80ae01af96635f4572191f00c7ace58f5 /lisp/emacs-lisp | |
parent | f5388ba8a7f3970afd0e2bcc52c834ae56178442 (diff) | |
download | emacs-244de7b0ed3bb23e700c9edef51e413602d8720a.tar.gz |
Use lexical binding in benchmark.el
* lisp/emacs-lisp/benchmark.el: Enable lexical binding.
(benchmark-elapse): Use 'declare'.
* test/lisp/emacs-lisp/benchmark-tests.el: Add test suite.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/benchmark.el | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el index 25eddf5f6b0..a2217d20953 100644 --- a/lisp/emacs-lisp/benchmark.el +++ b/lisp/emacs-lisp/benchmark.el @@ -1,4 +1,4 @@ -;;; benchmark.el --- support for benchmarking code +;;; benchmark.el --- support for benchmarking code -*- lexical-binding: t -*- ;; Copyright (C) 2003-2017 Free Software Foundation, Inc. @@ -33,6 +33,7 @@ (defmacro benchmark-elapse (&rest forms) "Return the time in seconds elapsed for execution of FORMS." + (declare (indent 0) (debug t)) (let ((t1 (make-symbol "t1")) (t2 (make-symbol "t2"))) `(let (,t1 ,t2) @@ -41,9 +42,6 @@ (setq ,t2 (current-time)) (float-time (time-subtract ,t2 ,t1))))) -(put 'benchmark-elapse 'edebug-form-spec t) -(put 'benchmark-elapse 'lisp-indent-function 0) - ;;;###autoload (defmacro benchmark-run (&optional repetitions &rest forms) "Time execution of FORMS. |