Need current time in milliseconds

Sep 28, 2010 at 7:52pm
I am producing a log that needs millisecond resolution in linux c/c++. I know that it can be inaccurate, but at least its more resolution than seconds. Is there a get current time with milliseconds or microseconds? I can convert microseconds up to milliseconds if necessary.

Thanks,
Robert
Sep 28, 2010 at 9:14pm
Look up clock_gettime().
Sep 28, 2010 at 9:31pm
I think I found gettimeofday which is simpler than clock_gettime. Hopefully it will give me what I am looking for.

Thanks for the help,
Robert
Oct 2, 2010 at 6:06am
Thanks for the help
Topic archived. No new replies allowed.