Talk:VSYNC vs WAIT/@comment-25827645-20141210012405/@comment-9531161-20141211185556

A more pointed test, if you're interested:

FRAMES=0 A=MAINCNTL FOR I=0 TO 100 FOR J=0 TO 500:NEXT WAIT 1 NEXT PRINT "WAIT:"MAINCNTL-A FRAMES=0 A=MAINCNTL FOR I=0 TO 100 FOR J=0 TO 500:NEXT VSYNC 1 NEXT PRINT "VSYNC:"MAINCNTL-A

Results: Both take about 100 frames.

Here's some interesting points though: the inner for loop (a simulated calculation) takes about half a frame. If wait actually waited the whole frame, the first loop should take 150 frames. Instead it takes 101 frames. The VSYNC loop makes sense, since the calculation portion only takes half a frame and thus VSYNC would take us to the next frame, making 102 frames (close enough). HOWEVER: what if we make the inner for loop (fake calculations) take ALMOST a full frame, so make it something like 1000? Wait now takes double the time (202 frames), but VSYNC is still 102 frames. This is very confusing; it's almost like they both wait an uneven amount of time, but WAIT stops at a different time than VSYNC.