How to find run time of a program from commmand line?

I just ran a program and wish to know how much time it took to execute it. How do I do it?


Solution 1:

Use time [programname].

Example:

host:~$ time dmesg

[massive gob of dmesg output]

real    0m2.630s
user    0m0.000s
sys     0m0.030s