Slow code?

Blitz3D Forums/Blitz3D Beginners Area/Slow code?

Nicstt(Posted 2006) [#1]
Ive been working on my project and came accross a problem.

The code in the if/then statement opperates in 2 millisecs, however if i activate the flip statement it takes 20 seconds to complete.

It seems an aweful lot of processor time for just the flip statement.

Anyone else come accross this, or am I missing something?

Repeat
; Cls
; DrawImage gfxTemp, 0, 0
; DrawImage gfxTemp2, 717, 707
; DrawImage gfxP2pointer, plTwoTimeX, plTwoTimeY
; DisplayTimes()
; Flip

If vocab\number < lastWord
vocab = After vocab
Else
test2 = MilliSecs()
test3# = Float(test2-test1)/1000
Notify test3# : End
EndIf

Forever


jfk EO-11110(Posted 2006) [#2]
Flip will wait for the next Vsync. So it waits max. 17 milliseconds when your monitor is set to 60Hz refresh-rate.
Depending on the number of Flip calls this may take a while.

You can use "Flip 0", this will not wait for the vsync, but flip backbuffer and frontbuffer immediately, regardless of any unsynced look.


Nicstt(Posted 2006) [#3]
Thx for that going to try it out now:)


Nicstt(Posted 2006) [#4]
Made big difference thanks again