Reputation: 7491
If I run a program ./a.out, and want to measure the time this program run. Is there such a command?
>> ./a.out
>> time xxxx
Thanks!
Upvotes: 0
Views: 2562
Reputation: 29265
time ./a.out
works on most Linux systems...
For more detail use:
man time
Upvotes: 1
Reputation: 2541
SECONDS=0
run_your_program
echo $SECONDS
as an alternative to all the "time" suggestions bound to come up as answer. SECONDS is initialised to 0 when shell starts, therefore you can also do calculations on before-after values, instead of initialising it to a specific value yourself. Useful as a kind of lap timer
Upvotes: 3