aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorTino Calancha2017-03-03 18:26:30 +0900
committerTino Calancha2017-03-03 18:26:30 +0900
commit244de7b0ed3bb23e700c9edef51e413602d8720a (patch)
treec61679d80ae01af96635f4572191f00c7ace58f5 /lisp
parentf5388ba8a7f3970afd0e2bcc52c834ae56178442 (diff)
downloademacs-244de7b0ed3bb23e700c9edef51e413602d8720a.tar.gz
emacs-244de7b0ed3bb23e700c9edef51e413602d8720a.zip
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')
-rw-r--r--lisp/emacs-lisp/benchmark.el6
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 @@
1;;; benchmark.el --- support for benchmarking code 1;;; benchmark.el --- support for benchmarking code -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2003-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2017 Free Software Foundation, Inc.
4 4
@@ -33,6 +33,7 @@
33 33
34(defmacro benchmark-elapse (&rest forms) 34(defmacro benchmark-elapse (&rest forms)
35 "Return the time in seconds elapsed for execution of FORMS." 35 "Return the time in seconds elapsed for execution of FORMS."
36 (declare (indent 0) (debug t))
36 (let ((t1 (make-symbol "t1")) 37 (let ((t1 (make-symbol "t1"))
37 (t2 (make-symbol "t2"))) 38 (t2 (make-symbol "t2")))
38 `(let (,t1 ,t2) 39 `(let (,t1 ,t2)
@@ -41,9 +42,6 @@
41 (setq ,t2 (current-time)) 42 (setq ,t2 (current-time))
42 (float-time (time-subtract ,t2 ,t1))))) 43 (float-time (time-subtract ,t2 ,t1)))))
43 44
44(put 'benchmark-elapse 'edebug-form-spec t)
45(put 'benchmark-elapse 'lisp-indent-function 0)
46
47;;;###autoload 45;;;###autoload
48(defmacro benchmark-run (&optional repetitions &rest forms) 46(defmacro benchmark-run (&optional repetitions &rest forms)
49 "Time execution of FORMS. 47 "Time execution of FORMS.