How can I get time in milliseconds in a Bash shell script?
date +%s%N
returns the number of seconds + current nanoseconds.
Therefore, echo $(($(date +%s%N)/1000000))
is what you need.
Example:
$ echo $(($(date +%s%N)/1000000))
1535546718115
date +%s
returns the number of seconds since the epoch, if that's useful.