limitation: it won't work if you grab the time before midnight, and then subtract after. Which is easily accounted for.
Also the oResponse object has a TTLB (time to last byte) item.
timeElapsed = oResponse.TTLB
That will also give you similar results. The only drawback is that it wouldn't measure the time elapsed if you don't get a good response (if there was an error or timeout). Becuase then the oResponse object would be "nothing" and not have a TTLB at all. Any calls to it at that point would crash the script. When using TTLB, it's best to put in an If that checks to make sure oResponse isn't null.