1.0.23.37: more CLOS and classoid thread safety
[sbcl/tcr.git] / tests / time.pure.lisp
bloba9aac4c80ab82894eb1d0c5604bbcbf7c1d15e2f
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; While most of SBCL is derived from the CMU CL system, the test
5 ;;;; files (like this one) were written from scratch after the fork
6 ;;;; from CMU CL.
7 ;;;;
8 ;;;; This software is in the public domain and is provided with
9 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
10 ;;;; more information.
12 (in-package "CL-USER")
14 ;;; Test for monotonicity of GET-INTERNAL-RUN-TIME. (On OpenBSD, this
15 ;;; is not a given, because of a longstanding bug in getrusage().)
16 (funcall (compile nil
17 '(lambda (n-seconds)
18 (declare (type fixnum n-seconds))
19 (let* ((n-internal-time-units
20 (* n-seconds
21 internal-time-units-per-second))
22 (time0 (get-internal-run-time))
23 (time1 (+ time0 n-internal-time-units)))
24 (loop
25 (let ((time (get-internal-run-time)))
26 (assert (>= time time0))
27 (when (>= time time1)
28 (return)))))))
31 (with-test (:name :time/lambdas-converted)
32 (time (compile nil '(lambda () 42))))