My dear, the final ticks of the example "XMLHTTPRequest" are wrong.
This is because although you avoid code evolution with $($ticks, 0), in the course of the code, .timer, successive calls, the $ ticks an hour to pass as identifier and turns just number.
The actual response time for both examples is pretty much the same.
Do the test.
Put a: "set -l% ticks $ticks" at the beginning of the on signal and print it at the end for you to see.
Hugs.