Is there a shell command in Linux to get the time in milliseconds?
I just wanted to add to Alper's answer what I had to do to get this stuff working:
On Mac, you'll need brew install coreutils, so we can use gdate. Otherwise on Linux, it's just date. And this function will help you time commands without having to create temporary files or anything:
function timeit() {
start=`gdate +%s%N`
bash -c $1
end=`gdate +%s%N`
runtime=$(((end-start)/1000000000.0))
echo " seconds"
}
And you can use it with a string:
timeit 'tsc --noEmit'