Add some timing code, avoid system call when receiving new data from the network with an empty buffer