[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash scripting question



Paul E Condon wrote:

Try:

bgn=$(date +%s)
sleep 7
end=$(date +%s)
echo "elapsed seconds = " $(( end - bgn ))


You might also want to experiment with:

ps h -o etime $$

as long as you're happy with it only running under gnu. Prints the elapsed time for the shell.

--
Chris Jackson
Shadowcat Systems Ltd.


Reply to: