Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defclass counter ()
- ((value :initform 0 :accessor counter-value)))
- (defgeneric m-inc (counter)
- (:method ((counter counter))
- (incf (counter-value counter))))
- (defun f-inc (counter)
- (incf (counter-value counter)))
- (time (loop :with c := (make-instance 'counter)
- :repeat 1000000
- :do (m-inc c)
- :finally (return (counter-value c))))
- (time (loop :with c := (make-instance 'counter)
- :repeat 1000000
- :do (f-inc c)
- :finally (return (counter-value c))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement