Fixed a timing error.
Previously, the call to poll() would use a timeout which was too small,
causing large CPU spikes. The timeout calculate is now fixed.