I am creating a basic script in which I would like to get the runtime of a program each time it is called in the script.
#!/bin/bash
for i in {1..15}
do
echo "Execucao $i"
time ./meu_programa > resultados_nesse_arquivo.txt
done
But when I run this script, I get only the standard output from my program, how can I get a similar result like:
Execucao X
real 0m0,001s
user 0m0,001s
sys 0m0,000s