Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Time-a-function/Common-Lisp/time-a-function-1.lisp
Normal file
8
Task/Time-a-function/Common-Lisp/time-a-function-1.lisp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
CL-USER> (time (reduce #'+ (make-list 100000 :initial-element 1)))
|
||||
Evaluation took:
|
||||
0.151 seconds of real time
|
||||
0.019035 seconds of user run time
|
||||
0.01807 seconds of system run time
|
||||
0 calls to %EVAL
|
||||
0 page faults and
|
||||
2,400,256 bytes consed.
|
||||
10
Task/Time-a-function/Common-Lisp/time-a-function-2.lisp
Normal file
10
Task/Time-a-function/Common-Lisp/time-a-function-2.lisp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(defun timings (function)
|
||||
(let ((real-base (get-internal-real-time))
|
||||
(run-base (get-internal-run-time)))
|
||||
(funcall function)
|
||||
(values (/ (- (get-internal-real-time) real-base) internal-time-units-per-second)
|
||||
(/ (- (get-internal-run-time) run-base) internal-time-units-per-second))))
|
||||
|
||||
CL-USER> (timings (lambda () (reduce #'+ (make-list 100000 :initial-element 1))))
|
||||
17/500
|
||||
7/250
|
||||
Loading…
Add table
Add a link
Reference in a new issue