# Timing accuracy

**URL:** <https://psychtoolbox.discourse.group/t/timing-accuracy/1849>\
**Category:** Uncategorized\
**Created:** [June 22, 2007, 3:06pm UTC](https://psychtoolbox.discourse.group/t/timing-accuracy/1849 "2007-06-22T15:06:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [June 22, 2007, 3:06pm UTC](https://psychtoolbox.discourse.group/t/timing-accuracy/1849/1 "2007-06-22T15:06:04Z")

</div>

Has anybody measured the relation between "Screen"'s  
"FlipTimestamp"/"VBLTimestamp" and actual changes in luminance on a  
CRT screen using a photodiode?   
  
Same question for "KbCheck"'s "secs" relative to the actual keypress.

---

<div class="post-metadata">

**Author:** ![e\_flister](https://avatars.discourse-cdn.com/v4/letter/e/e36b37/32.png) [@e\_flister](https://psychtoolbox.discourse.group/u/e_flister)\
**Post date:** [June 23, 2007, 11:41am UTC](https://psychtoolbox.discourse.group/t/timing-accuracy/1849/2 "2007-06-23T11:41:40Z")

</div>

the thread including msg 5421 might have some of what you're looking for.  
-e

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [June 25, 2007, 8:10pm UTC](https://psychtoolbox.discourse.group/t/timing-accuracy/1849/3 "2007-06-25T20:10:02Z")

</div>

A few people, including Erik Flister and me, did it in a quick  
and dirty way on different setups.  
  
I did some quick and dirty tests a couple of months ago with  
a photo-diode, a CRT and some trigger box on WinXP with  
NVidia hardware.  
  
I didn't take any notes or calculate any statistics, just a series  
of repeated measurements under different loads to see if  
it looks good. All tests showed that the VBLTimestamp/  
Stimulusonsettimestamps are in agreement with the photo-  
diode. Measured difference was less than 1 millisecond,  
however that was also the resolution of my equipment, so  
i can't make any claims as to how much more accurate than  
1 msecs it was. In theory it should be accurate to a few dozen  
microseconds, but one would need a better measurement  
technique to resolve that.  
  
We did something similar when testing the new low latency sound  
driver on WindowsXP and OS/X MacBookPro, basically comparing  
emitted sound pulses with emitted light pulses and found  
similar results - better than 1 msec.  
  
So i assume the timestamps are pretty reliable on a CRT on a  
properly configured setup, but any kind of independent  
measurements is very welcome. Theres a restriction on MS-Windows:  
The high precision timestamping is disabled when PTB detects  
any of these: a) broken systems, b) Intel graphics chips,  
c) Dual display setups, so noise of the timestamps may  
be much higher in those cases. In case c), one can manually  
reenable the mechanism after checking that everything is  
ok.  
  
Regarding KbCheck: I'm not aware of anybody testing this  
recently. I'd expect the latency between registration of a  
keypress by the computers hardware and the reported keypress  
by KbCheck to be lower than 1 millisecond, but the real problem  
is the keyboards and USB connection: If you use a standard  
keyboard connected to your computer with a standard USB  
connection you can get latencies or timing jitter in  
the range anywhere between 20 - 50 msecs (worst case),  
depending on keyboard, experiment and typing behaviour  
of your subject.  
  
This is an inherent limitation of keyboard technology, nothing  
solvable by software. There are companies that sell keyboards  
specially tailored to the needs of psychophysics, these should  
do much better (for a much higher price tag) - they are basically  
response boxes that look (to you) and act (wrt. to the operating  
system) mostly like normal keyboards, but they are response boxes.  
  
best,  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "rogierland" \<rogierland@...\> wrote:  
> \>  
> \> Has anybody measured the relation between "Screen"'s  
> \> "FlipTimestamp"/"VBLTimestamp" and actual changes in luminance on a  
> \> CRT screen using a photodiode?   
> \>   
> \> Same question for "KbCheck"'s "secs" relative to the actual keypress.  
> \>
