It is obvious you will not get nanosecond precision - because the O/S scheduler is (obviously) going to get in the way.
Precision will be nanosecond, because the result will be the number of nanoseconds (which, after all, provides the mentioned function). At most, it will deviate from reality to some extent — I know that.
In my case, if the deviation from the actual measurement will not be greater than, let's assume, 0.1ms, it will not cause noticeably malfunction of the program. Noticeably, because it is about the perception of the human eye, not about the possibility of errors in the program. And I suspect that in typical conditions such large distortions do not occur (more than assumed 100000ns). But if so, the worst thing that can happen is a normal lag, that will not destabilize the program in any way.
I care more specifically about the function
clock_get_system_nanotime, because it returns the result in nanoseconds (in a known unit of time), which then I can use in the function
FpNanoSleep, without any complex calculations, rounding and similar. Just one multiplication and done. The final code will be short and easy to understand for everyone (including me), and this is importontant (at least for me).
Just for the record, in spite of the above, if I had an example of what you requested, I'd provide it to you.
I appreciate. In the meantime, I will try to write it myself, but I still will not be able to check it out in practice, so I will ask for a test.