(defun sb-sprof-example-fun (x y) (declare #+(or) (type fixnum x) (type (unsigned-byte 16) y)) (dotimes (i y) ;; exercise: see what happens when you replace ;; the quotient with (1+ most-positive-fixnum) (setf x (mod (+ x x) most-positive-fixnum))) (sleep 0.01) (values x (mod x y))) (defun sb-sprof-example (&optional (mode :cpu)) (declare (type (member :time :cpu :alloc) mode)) (sb-sprof:with-profiling (:mode mode :report :flat :loop t :max-samples 1000) (dotimes (i 200) (sb-sprof-example-fun 3 #xffff))))