How to format struct timespec to string? This structure is returned e.g. by clock_gettime() on Linux gcc:
struct timespec
clock_gettime()
struct timespec { tim
One way to format it is:
printf("%lld.%.9ld", (long long)ts.tv_sec, ts.tv_nsec);