Tweak how query elapsed time is calculated.
Merge branch '4.0'