Improve the timer resolution and remove a sleep call