Formatting struct timespec August 7, 2023 by Tarik One way to format it is: printf("%lld.%.9ld", (long long)ts.tv_sec, ts.tv_nsec);