Here's a code to point out something rather annoying:
Code: Select all
If OpenWindow(0, 0, 0, 460, 400, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
canvas = CanvasGadget(#PB_Any , 10, 10, 380, 380, #PB_Canvas_ClipMouse)
t=ElapsedMilliseconds()
For i = 0 To 1000
StartDrawing(CanvasOutput(canvas))
StopDrawing()
Next
t2 = ElapsedMilliseconds() - t
MessageRequester("",Str(t2))
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
It makes no sense to do 1000 Start/EndDrawing here, but my code is using several Start/endrawing to get the text width and lenght, and is very slow when parsing 1000 lines because of what I shown before.
Why is it taking 1.5 seconds to do nothing? Why is it slower than when using an image?



