How to get the time at millisecond level on Linux with command line?

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

asked Jun 2, 2014 by Eric Z Ma (44,280 points)

1 Answer

 
Best answer

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

date +%s.%N
answered Jun 2, 2014 by Eric Z Ma (44,280 points)
selected Jun 2, 2014 by Eric Z Ma

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...