按键最大响应时间
我在一家开发心理测试的公司工作。其中一项测试衡量候选人的反应时间。
任何人都知道按键和该按键事件可用的时间之间的最大延迟吗?有哪些依赖关系? 是否有保证的最大响应时间?我读了大约 5 - 25 毫秒的内容。 处理按键事件以最小延迟的最佳方法是什么?
提前致谢, 凯文
I work for a company that develops psychological tests. One of these tests measures the reaction time of a candidate.
Anyone has an idea of the maximum delay between a key press and the time that this key event is available? What are the dependencies?
Is there a guaranteed maximum response time? I readed something about 5 - 25 ms.
What is the best way to handle keyevents to have a minimum delay?
Thanks in advance,
Kevin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Windows UI 处理非常复杂。它包括诸如按键优先级提升之类的算法,但如果另一个进程要求完整的 CPU 周期,它通常会等到下一个调度程序ticket(最坏情况下,桌面系统上为 30 毫秒,服务器系统上为 60 毫秒),
要克服这个问题,您需要一个特殊的键盘驱动程序,可以在相同的延迟下提供事件,但也可以测量准确的时间。如果禁用动态 CPU 时钟切换,则在 Windows 系统上可以进行精确的时间测量(查找入口 QueryPerformanceCounter(),您需要知道如何从 DDK 调用它),在这种情况下,键盘事件仍然会以不可预测的延迟到达,但是原始总线事件将被正确标记时间戳。然后,您只保留总线延迟,该延迟应小于测量的标准偏差。另请参阅从我们按下键盘上的某个键到它出现在您的 Word 文档中会发生什么
Windows UI processing is very complex. It includes algorithms like priority promotion on keypress, but it will usually wait until the next scheduler ticklet (at worst, 30ms on desktop systems and 60ms on server systems) if another process asks for a full CPU cycle,
To overcome that, you would need a special keyboard driver that would provide event at the same latency, but also measure the accurate time. Accurate time measurement is possible on windows systems if dynamic CPU clock switching is disabled (Lookup entry QueryPerformanceCounter(), you would need to know how to invoke it from DDK), in which case, the keyboard event would still arrive with unpredictable latency, but the original bus event would be time-stamped correctly. Then you remain only with bus latencis which should be smaller than the standard deviation of your measurements. See also What happens from the moment we press a key on the keyboard, until it appears in your word document