Provide a ms based sleep function that uses nanosleep to avoid the inaccuracy of usleep on SMP systems.