Ok I have created a similar a benchmark maybe it is not good one but you can have a view of something the speed
Here my code :
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Created by threedslider 01/31/2024
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Procedure _2D_Rectangle_shape(x1, y1, x2, y2, r1, g1, b1)
StartDrawing(ScreenOutput())
For y = y1 To y2
For x = x1 To x2
Plot(x,y,RGB(r1, g1, b1))
Next
Next
StopDrawing()
EndProcedure
Procedure _2D_Rectangle_benchmark(r, g, b)
randUp1 = Random(790)
randUp2 = Random(590)
randDown1 = Random(790)
randDown2 = Random(590)
bg_r = r
bg_g = g
bg_b = b
_2D_Rectangle_shape(randUp1, randUp2, randDown1, randDown2, bg_r, bg_g, bg_b)
EndProcedure
InitSprite()
InitKeyboard()
OpenWindow(1, 0,0,800,600,"2d rectangle shape benchmark", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(1),0,0,800,600,0,0,0)
ClearScreen(RGB(0,0,0))
stop = 0
color_change = 1
Repeat
ExamineKeyboard()
stop = stop + 1
color_change = color_change + 1
event = WindowEvent()
If color_change > 0 And color_change < 255
_2D_Rectangle_benchmark(255-color_change, 0+color_change, 255-color_change )
Else
If color_change >= 255
color_change = 0
color_change = color_change + 1
_2D_Rectangle_benchmark(0+color_change, 255-color_change, 0+color_change )
EndIf
EndIf
time.q = ElapsedMilliseconds()
FlipBuffers()
Debug time/1000
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape) Or stop = 1000
End
You need to compile in debugger you view in time which take it.
So mine it took 8 seconds and you ?