Skip to content

Commit

Permalink
only check for timeouts once per second
Browse files Browse the repository at this point in the history
  • Loading branch information
vii committed May 31, 2009
1 parent b408f9a commit 1a10cf8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/io/epoll.lisp
Expand Up @@ -82,7 +82,7 @@
(with-shorthand-accessor (my epoll *global-epoll*)
(my 'mux-del fd)))

(defun events-pending-p ()
(defun-speedy events-pending-p ()
(not (mux-empty *global-epoll*)))


Expand All @@ -102,7 +102,13 @@
(defun event-loop ()
(loop for timeout = (next-timeout)
while (or timeout (events-pending-p)) do
(wait-for-next-event timeout)))
(wait-for-next-event timeout)
(let ((start-time (get-universal-time)))
(loop
while (events-pending-p)
do
(wait-for-next-event 1)
thereis (/= start-time (get-universal-time))))))

(defun event-loop-reset ()
(mux-close-all *global-epoll*)
Expand Down

0 comments on commit 1a10cf8

Please sign in to comment.