I need to measure how quickly a user responds to something in my app. Their response is in the form of sending a Meteor Method Call to the server.
I have a lot of users doing this at the same time, so I’m not wanting to just do a
Date.now() in the method code on the server because that seems like it would be prone to delay if the server is processing a large queue of responses. And this needs to be precise as possible.
I don’t want to take the value from a timestamp from the client because 1) their clock may be off and 2) it’s not secure even if their clock was in sync with the server.
One idea I had was trying to figure out how to get the
Date HTTP header from the actual request using a package like gadicohen:headers but it doesn’t include any date or timestamp info. I’m assuming the header
Date field would have a time that’s less prone to server business though even this is probably prone to some delay if the server is busy. Not sure, but I assume so.
Does anyone know how to access the time a Meteor Method response originated and/or when it was received by the server from within the method’s server code (versus doing a timestamp when the server code for the method actually runs)? Is there some DDP or request data somewhere?
Or another way to solve this?