anchor.diff:      timer))
   
   (defun stop-timer (timer)
  -  (cond
  -    ((timer-idle-p timer)
  -     (setf (timer-alive-p timer) nil)
  -     (setf *idle-timer-list* (delete timer *idle-timer-list*))
  -     (setf *timer-list* (delete timer *timer-list*)))
  -    (t
  -     (setf (timer-alive-p timer) nil)
  -     (setf *timer-list* (delete timer *timer-list*)))))
  +  (progn
  +    (setf (timer-alive-p timer) nil)
  +    (if (timer-idle-p timer)
  +        (setf *idle-timer-list* (delete timer *idle-timer-list*))
  +        (setf *timer-list* (delete timer *timer-list*)))))
   
   (defun update-timer ()
     (let* ((tick-time (get-internal-real-time))
  +         (target-timers (if *is-in-idle*
  +                            (append *timer-list* *idle-timer-list*)
  +                            *timer-list*))
            (updating-timers (remove-if-not (lambda (timer)
                                              (< (timer-next-time timer) tick-time))
  -                                         *timer-list*))
  +                                         target-timers))
            (deleting-timers (remove-if-not (lambda (timer)
  -                                           (or (timer-idle-p timer)
  -                                               (not (timer-repeat-p timer))))
  -                                         updating-timers)))
  +                                           (not (timer-repeat-p timer)))
  +                                         updating-timers))
  +         (updating-idle-timers (if *is-in-idle*
  +                                   (remove-if-not (lambda (timer)
  +                                                    (and (timer-idle-p timer)
  +                                                         (timer-repeat-p timer)))
  +                                                  updating-timers)
  +                                   '())))
       (dolist (timer deleting-timers)
  -      (unless (and (timer-idle-p timer)
  -                   (timer-repeat-p timer))
  -        (setf (timer-alive-p timer) nil)))
  +      (setf (timer-alive-p timer) nil))
       ;; Not so efficient, but it will be enough.
       (setf *timer-list* (set-difference *timer-list* deleting-timers))
  +    (when *is-in-idle*
  +      (setf *idle-timer-list* (set-difference *idle-timer-list* deleting-timers))
  +      (setf *idle-timer-list* (set-difference *idle-timer-list* updating-idle-timers))
  +      (setf *processed-idle-timer-list* (nconc updating-idle-timers *processed-idle-timer-list*)))
   
       (dolist (timer updating-timers)
         (unless (and (timer-idle-p timer)
  
positive.code:     (not (null updating-timers))))
  
  (defun shortest-wait-timers ()
    (if (null *timer-list*)
        nil
        (- (loop :for timer :in *timer-list*
                 :minimize (timer-next-time timer))
           (get-internal-real-time))))
  
  (defun exist-running-timer-p ()
    (not (null *timer-list*)))
  
  (defun start-idle-timer (ms repeat-p function &optional handle-function name)
    (let ((timer (make-instance 'timer
  
negative.code:     timer))
  
  (defun start-idle-timers ()
    (progn
      (setf *is-in-idle* t)
      (dolist (timer *idle-timer-list*)
        (setf (timer-last-time timer) (get-internal-real-time))
        (setf (timer-alive-p timer) t))))
  
  (defun stop-idle-timers ()
    (progn
      (setf *is-in-idle* nil)
      (setf *idle-timer-list* (nconc *processed-idle-timer-list* *idle-timer-list*))
      (setf *processed-idle-timer-list* '())))
  