This should work assuming it's always in milliseconds.
awk '/^elapsed time:/ {T+=$3;C++}; END {print T/C}' test.txt
`/^elapsed time:/` find lines matching desired pattern
`{T+=$3;C++};` add the third column in `T` up and count how many times we do it `C`
`END {print T/C}` print out our average.