You will probably not be able to sleep for a single nano second because the available resolution depends on the granularity of the underlying clock which is system dependant. If the underlying clock has not a resolution of a nano second or less, the passed value will be by rounded up.
See also the OpenGroup specification
nanosleep[
^] and the
nanosleep(2): high-resolution sleep - Linux man page[
^].
To get the resolution of the hardware clock see
clock_getres(2): clock/time functions - Linux man page[
^]. Note that there is also the
clock_nanosleep(2) - Linux man page[
^] function which allows specification of the clock to be used.
When using sleep functions only the current thread (or the current process when it is single threaded) will be waiting. Other threads including the kernel will continue operation.