anchor.diff:    (timer :timer :read-only t)
     (fps-count 0)
     (fps-limit 5)
  -  (fps       0))
  +  (fps 0.0))
   
   (defun init-framerate-counter ()
     (let ((timer (create-timer)))
  
positive.code: 
  (defvar *flops-per-interaction* 20)
  
  (defun compute-perf-stats (num-bodies fps iterations)
    (let* ((interactions-per-second (/ (* num-bodies num-bodies iterations)
                                       (/ 1.0 fps)
                                       1.0e9))
           (gflops                  (* interactions-per-second *flops-per-interaction*)))
      (values interactions-per-second gflops)))
  
  (let ((fps-count 0)
        (fps-limit 5)
        (template "CUDA N-Body (~A bodies): ~,1F fps | ~,1F BIPS | ~,1F GFLOP/s | single precision~%"))
    (defun display-framerate (num-bodies fps)
      (incf fps-count)
      (when (>= fps-count fps-limit)
        (multiple-value-bind (interactions-per-second gflops)
            (compute-perf-stats num-bodies fps 1)
          (format t template num-bodies fps interactions-per-second gflops)
          (glut:set-window-title (format nil template num-bodies fps interactions-per-second gflops)))
        (setf fps-count 0
              fps-limit (max fps 1.0)))))
  
  
  ;;;
  
negative.code:      (unwind-protect (progn ,@body)
         (release-framerate-counter ,var))))
  
  (defun measure-framerate-counter (counter)
    (symbol-macrolet ((timer (framerate-counter-timer counter))
                      (fps (framerate-counter-fps counter))
                      (fps-count (framerate-counter-fps-count counter))
                      (fps-limit (framerate-counter-fps-limit counter)))
      ;; increment fps-count
      (incf fps-count)
      ;; compute fps for certain period
      (when (>= fps-count fps-limit)
        (let* ((elapsed-time (progn
                               (stop-timer timer)
                               (synchronize-timer timer)
                               (prog1 (elapsed-time timer)
                                 (start-timer timer))))
               (milliseconds (/ elapsed-time fps-count)))
          (setf fps (/ 1.0 (/ milliseconds 1000.0))))
        (setf fps-limit (max fps 1.0))
        (setf fps-count 0))))
  
  
  ;;;
  