Question about the timing of Screen Flip

I tried a simple code including the following lines. So the screen was flickering at 15 Hz, with 60 Hz of monitor refresh rate.

...
waitframe = 1;
ifi = Screen('GetFlipInterval',w);
tvbl = Screen('Flip',w);
tvbls = [];
k = 1;
while ~KbCheck
Screen('FillRect',w,128-127*(-1)^k);
tvbl = Screen('Flip',w,tvbl+(waitframe-0.5)*ifi);
tvbls = [tvbls tvbl];
k = 3-k;
end
...


I though the result of diff(tvbls) would be around .033 (i.e. 2*ifi). But I found they were around .0267. But if waitframe was set to zero, i.e. the screen flip at every vertical retrace, diff(tvbls) became closely around .016. Why?
That is funny. What operating system are you running (version, etc all the details) and what graphics card? You are using a fullscreen window, right?
Best,
Dee


On Thu, Apr 18, 2013 at 11:16 PM, ptbmin <ptbmin@...> wrote:

I tried a simple code including the following lines. So the screen was flickering at 15 Hz, with 60 Hz of monitor refresh rate.

...
waitframe = 1;
ifi = Screen('GetFlipInterval',w);
tvbl = Screen('Flip',w);
tvbls = [];
k = 1;
while ~KbCheck
Screen('FillRect',w,128-127*(-1)^k);
tvbl = Screen('Flip',w,tvbl+(waitframe-0.5)*ifi);
tvbls = [tvbls tvbl];
k = 3-k;
end
...

I though the result of diff(tvbls) would be around .033 (i.e. 2*ifi). But I found they were around .0267. But if waitframe was set to zero, i.e. the screen flip at every vertical retrace, diff(tvbls) became closely around .016. Why?


I tried the same code on another computer, and the results looked OK. Both computers are installed with Windows 7. The difference is the one I tried yesterday has two graphics cards with the nVidia Optimus technique. It seems the Optimus technique messed up everything.

--- In psychtoolbox@yahoogroups.com, "Diederick C. Niehorster" <dcnieho@...> wrote:
>
> That is funny. What operating system are you running (version, etc all the
> details) and what graphics card? You are using a fullscreen window, right?
>
> Best,
> Dee
>
>
> On Thu, Apr 18, 2013 at 11:16 PM, ptbmin <ptbmin@...> wrote:
>
> > **
> >
> >
> > I tried a simple code including the following lines. So the screen was
> > flickering at 15 Hz, with 60 Hz of monitor refresh rate.
> >
> > ...
> > waitframe = 1;
> > ifi = Screen('GetFlipInterval',w);
> > tvbl = Screen('Flip',w);
> > tvbls = [];
> > k = 1;
> > while ~KbCheck
> > Screen('FillRect',w,128-127*(-1)^k);
> > tvbl = Screen('Flip',w,tvbl+(waitframe-0.5)*ifi);
> > tvbls = [tvbls tvbl];
> > k = 3-k;
> > end
> > ...
> >
> > I though the result of diff(tvbls) would be around .033 (i.e. 2*ifi). But
> > I found they were around .0267. But if waitframe was set to zero, i.e. the
> > screen flip at every vertical retrace, diff(tvbls) became closely around
> > .016. Why?
> >
> >
> >
>