b3b24c147bf7a29ff4f71d736f9d0337c776e918
[jscl.git] / src / misc.lisp
1 ;;; misc.lisp --
2
3 ;; JSCL is free software: you can redistribute it and/or
4 ;; modify it under the terms of the GNU General Public License as
5 ;; published by the Free Software Foundation, either version 3 of the
6 ;; License, or (at your option) any later version.
7 ;;
8 ;; JSCL is distributed in the hope that it will be useful, but
9 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 ;; General Public License for more details.
12 ;;
13 ;; You should have received a copy of the GNU General Public License
14 ;; along with JSCL.  If not, see <http://www.gnu.org/licenses/>.
15
16 (defparameter *features* '(:jscl :common-lisp))
17
18 (defun lisp-implementation-type ()
19   "JSCL")
20
21 (defmacro time (form)
22   (let ((start (gensym))
23         (end (gensym)))
24     `(let ((,start (get-internal-real-time))
25            (,end))
26        (prog1 (progn ,form)
27          (setq ,end (get-internal-real-time))
28          (format t "Execution took ~a seconds.~%" (/ (- ,end ,start) 1000.0))))))