I'm working on a project to determine the end-to-end latency of a cloud gaming system (i.e., XCloud) on a MacBook.
I believe I have half of the process completed so far:
- A Javascript web app that logs every single time a user presses a button on their gamepad using the Mozilla GamePad API. The timestamp is calculated as milliseconds in Unix epoch time from the client's end.
- The server-side of the web app which places each button input and its timestamp into a database so that they can be used at a later time for latency analysis.
Using this, I am able to accurately determine each time I press a button on my gamepad along with the button itself. Now, I would like to figure out the exact time the corresponding frame(s) are displayed onto my screen.
As far as I understand, it seems like the generally accepted approach to determine on-screen changes from gamepad inputs is to set up a high-speed camera and capture the actual frames changing on the display. However, I'd like to use a method that can be automated more easily and takes advantage of the actual hardware on my laptop.
Is there a different approach to this? One that might take advantage of my frame buffer or can determine pixel change on my screen? To anyone who is knowledgeable of this or has done something similar before, can you point me in a better direction? I've done quite a bit of research to solve this problem, but I can't find anything online that somewhat fits my needs.
Thank you to anyone who is reading this!