Yes
You are using the correct interface. This is a Posix-specified HRT (High Resolution Timer) that is available in modern Loonix, and your use is the canonical standard.
For ping resolutions it probably doesn't matter, but it's possible to use CLOCK_MONOTONIC,
especially for short intervals. Under other conditions, CLOCK_REALTIME
may be more accurate. However, the exact meaning of these clocks is not specified by Posix, and on Linux, I believe all of them are subject to NTP adjustments. That's a good thing for long intervals, at least.
On Linux, to get access to the underlying hardware clock without NTP adjustments, you have to go off the Posix reservation and use CLOCK_MONOTONIC_RAW.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html