I'm assuming your using bash. First off, I assume that the line
elapsed=$(( end-time - start_time ))
is just a typo and that
end-time
should be
end_time
But looking at that statement, it's all just wrong. If you are using bash, then you could use a
let
expression to evaluate the elapsed time:
let elpased=$end_time-$start_time
If you're not using bash, and are using some other POSIX type shell that does not support the
let
syntax, you can always use
expr
elapsed=$(expr $end_time - $start_time)