Get the latest tech news

Measuring keyboard-to-photon latency with a light sensor (2023)


For a long time when I’ve wanted to test the latency of computers and UIs I’ve used the Is It Snappy app with my iPhone’s high speed camera to count frames between when I press a key and when the screen changes. However the problem with that is it takes a while to find the exact frames you want, which is annoying when doing a bunch of testing.

So I followed in the footsteps of my friend Raph and made a hardware latency tester which sends keyboard events and then uses a light sensor to measure the time it takes for the screen to change! I knew to suspect transition time, because before I wrote the firmware I played around with just sampling the light sensor every millisecond and using the Arduino serial plotter to plot measurements as I typed and backspaced a letter just to see what the signal looked like. Install the Teensyduino software and then you can use my latency tester Arduino sketch which also doubles as foot pedal box code but you can comment that stuff out and configure it to use the right pins.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of keyboard

keyboard

Photo of latency

latency

Photo of Photon

Photon

Related news:

News photo

Universe would die before monkey with keyboard writes Shakespeare, study finds

News photo

Hide the keyboard – it's the only way to keep this software running

News photo

Mac Pro Now Comes With USB-C Accessories, Including Magic Mouse and Keyboard