improved the nanosleep example
more improvements to the nanosleep example