Try to sleep for 0.5 ms when there is no data available, to ensure there will be.