user228001
user228001

Reputation: 11

bash script execution time in milliseconds on mac OSX

I'm trying to find execution time of a script in milliseconds.

I'm running a bunch of queries which are basically placed inside a for loop. Each query here is a actually a script. I want to find the time taken for each query.

Can someone help me to find the execution time in milliseconds please.

I have tried a bunch approaches with the 'time' and 'date' commands but couldn't land on a precise solution.

Thanks.

Upvotes: 0

Views: 845

Answers (1)

darkmutt
darkmutt

Reputation: 51

You could try:

time -v script_name

/usr/bin/time -v script_name # if mac delivers the program

https://coderwall.com/p/er_zca

the equivalent of strace for macos which should allow you to see the time of system calls between each of them.

Upvotes: 1

Related Questions