I know that gettimeofday() is a nice API. But how to get the number of seconds with milliseconds since the epoch time?

You can get the time at nano-seconds level (although it is not guaranteed that the last digits are accurate) by:

date +%s.%N

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *