TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

30 点作者 ossusermivami6 个月前

6 条评论

fhars6 个月前
So it looks like input latency on current hardware still has not quite caught up with the apple IIe, but is better that the PET 4016, so not all the hardware progress in the last seven yeas has been eaten by software: <a href="https:&#x2F;&#x2F;danluu.com&#x2F;input-lag&#x2F;" rel="nofollow">https:&#x2F;&#x2F;danluu.com&#x2F;input-lag&#x2F;</a>
schobi6 个月前
I love that he openly discusses the paths he went wrong and how more accuracy could be found. Detection threshold from the sensor or avoiding accidental synchronization to the monitor are not obvious pitfalls. The mini ASCII histogram is something I need myself - nice thought!<p>I remain puzzled on the goal. Does he optimize his setup for a good coding experience? (this should definitely include the actual keyboard in the measurements!) Is he optimizing editors? Picking a new monitor? As a learning excercise?<p>I&#x27;m all for &quot;because I can&quot; as a valid reason, but that often leaves my projects dangling halfway complete. Are we there yet? Don&#x27;t know - not sure where I want to be.
评论 #42099458 未加载
ezconnect6 个月前
He should have measured the latency on Facebook web messenger latency. I sometimes experience more than second even sometimes 2 secs per letter. Its amazing how can they make something so unusable on a very simple text input.
评论 #42099653 未加载
Aachen6 个月前
If someone wants to measure this latency without special hardware or code, check if your (friend&#x27;s) smartphone has a 1000 fps mode. I&#x27;m not caught up with newer phones but my 2019 Samsung has this and I use it all the time to look at things that happen quickly.<p>It just needs a lot of light (phone flashlight is sufficient at short range), or to emit light by itself like a screen (or microwave segment display, as a random example where you can see it lights up each digit individually and they&#x27;re never all on at the same time, but we can&#x27;t perceive that).<p>Method:<p>To measure, film the computer screen, positioning the phone in a way that it also captures the keyboard (best head on, since you&#x27;re interested in when vertical movement stops). Press record, strike a key, and go frame by frame on the recording. The moment the key bottoms out is pretty clear by your finger stopping to move down (if the focus is good, you also see a ripple effect in your hand). I know the trigger point will be before the key&#x27;s very bottom, but the whole key&#x27;s travel time is on the order of 2-3 frames = ~2-3 ms, which is good enough for me. Then, count frames until the computer screen updates. I usually wait for all channels before considering it updated (my work laptop emits only red on a separate refresh cycle, sometimes noticeable if you look away with some lucky timing in the right way)<p>Similarly for the mouse, though I usually pick it up and hold it in one hand before the screen and click the button in the air so that you can hold it in a good (for the camera) position more easily. By lifting your finger off the mouse button until the moment where you&#x27;re going to press it, the separation is very well visible on camera and the moment of pressing quite exactly determinable<p>Results:<p>On the LUKS disk password prompt at boot, latency is about 19 ms on a laptop. It feels extremely fast, a little like it shows the asterisk before I&#x27;ve finished pressing the key. After booting the OS, in gnome-terminal I get 48 ms. Connecting an external screen and keyboard via a cheap USB hub, it grows to 62 ms. Finally, inside the virtual machines we&#x27;re supposed to use for everything (because security), my input-to-photon latency is 134 ms. Guess I can see why that boot prompt feels like a time traveller compared to what I need to use all day long!<p>On a different setup (a family member&#x27;s iirc, running Windows) with an external monitor that has three gaming modes, called standard, fast, and faster, the latencies are 67, 67, and 62 ms. Pretty disappointing for a &quot;low latency gaming&quot; mode!<p>---<p>Compared to the submission:<p>&gt; One source of latency users experience that my tester doesn’t measure is keyboard latency.<p>The high speed camera method will include this, which is an advantage if you want to know how much latency your setup has, but doesn&#x27;t help you in picking apart where the latency occurs
评论 #42100474 未加载
taspeotis6 个月前
Related<p><a href="https:&#x2F;&#x2F;pavelfatin.com&#x2F;typing-with-pleasure&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pavelfatin.com&#x2F;typing-with-pleasure&#x2F;</a>
a-dub6 个月前
i&#x27;d consider using a signal generator (square waves), led and oscilloscope to characterize the response time of the sensor apparatus itself.
评论 #42099611 未加载