Replace sleep with proper os call.
Read whole file (up to buffer size) in one call to speed things up.