Use nanosleep rather than busy waiting to pause between updating