在bash中测量查询执行时间

我需要从一个bash脚本中测量一个查询总执行时间

有人告诉我要提交一些东西:

mysql --user="someuser" --password="pw" -D "dbname" -e 'your-sql-command;' 

这样对吗?

但是我怎样才能得到我需要的时间统计?

time

如在

 tom.oconnor@charcoal-black:/tmp$ time ls -lah total 20K drwxrwxrwt 26 root root 4.0K 2012-04-11 15:28 . drwxr-xr-x 23 root root 4.0K 2012-04-03 15:01 .. real 0m0.003s user 0m0.010s sys 0m0.000s 

很酷,嗯?

time manpage

 TIME(1) TIME(1) NAME time - run programs and summarize system resource usage