Example code often skip error handling, because that's not the point.
of course clock_gettime() should have its return value checked, just like you always check the return value of gettimeofday() and time()
of course clock_gettime() should have its return value checked, just like you always check the return value of gettimeofday() and time()