Paul,
If you developed this task from scratch using EP2.0.10 or later, and you
did not change the default settings, then you are using display flipping
whether you know it or not. Open up the Experiment Object Properties,
go to the Devices tab, open the Display device, and look at "Flipping
Enabled". If that is set to Yes, then your program uses flipping; if
that setting is No, or does not exist at all, then your program does not
use flipping. (And if you run this under Windows 10, then you must use
flipping, Windows 10 requires that; Windows 10 also requires 32 bit color.)
As explained at
support.pstnet.com/hc/en-us/articles/229362887-NEW-FEATURE-DisplayDevice-FlippingEnabled-18483-
, if your program uses flipping then every Canvas operation that
operates on the Display automatically does a wait for vertical blank, so
if you add Display.WaitForVerticalBlank you end up doing *two* waits for
vertical blank instead of one.
So if your program is set to use flipping, do *not* use
Display.WaitForVerticalBlank in your inline code, but if you really know
that your program does *not* use flipping then do use
Display.WaitForVerticalBlank.
To know more, you could sprinkle your code with Clock.Read to capture
various time points. E.g.,
c.SetAttrib "t.BeforeWaitForVerticalBlank", Clock.Read
Display.WaitForVerticalBlank
c.SetAttrib "t.AfterWaitForVerticalBlank" Clock.Read
myCanvas.LineTo 100, 100
c.SetAttrib "t.AfterCanvasOperation", Clock.Read
would tell you something. For a frame rate of 60 Hz,
(t.AfterWaitForVerticalBlank - t.BeforeWaitForVerticalBlank) should be 0
to 17 ms; with flipping enabled, (t.AfterCanvasOperation -
t.AfterWaitForVerticalBlank) should be 16 or 17 ms; without flipping
enabled, (t.AfterCanvasOperation - t.AfterWaitForVerticalBlank) should
be 0 or 1 ms. I will be interested in your results.
Best,
-- David McFarlane