I find no indication that there is a format for milliseconds in C. I save images more than once a second and need an additional index. My code now is:
time_t now;
struct tm ts;
time(&now);
ts = *localtime(&now);
strftime(buf, sizeof(buf), "%Y%m%d-%H%M%S", &ts);
Linux 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux GNU Make 4.1
gettimeofday()
andclock_gettime()
– Stéphane Chazelas Mar 25 '18 at 18:10