I need precise time stamp in my C program. Right now I'm using:
system("date +%H:%M:%S:%N");
which prints current time like:
09:29:26:616205874
Now I want to make this without the system();
call. I tried to use time.h
library but it goes only to seconds precision. How do I make time stamp, formated same as above?
Ok, based on comments I'll edit a little bit: I'm using debian based linux and the precision doesn't have to be necessary in nanoseconds, milisecond will suffice. I just asked about nanoseconds because that is what I use right now with the system();
call