Generate a random black and white   320x240   image continuously,
showing FPS (frames per second).



A sample image
 


' version 13-07-2018
' compile with: fbc -s console
'           or: fbc -s gui
 
' hit any to key to stop program
 
Randomize Timer
Screen 13
 
If ScreenPtr = 0 Then
    Print "Error setting video mode!"
    End
End If
 
Palette 0, 0                  ' black
Palette 1, RGB(255, 255, 255) ' white
 
Dim As UInteger c, x, y, Col
Dim As Double fps, t = Timer
 
' empty keyboard buffer
While InKey <> "" : Wend
 
While InKey = ""
 
    For x = 0 To 319
        For y = 0 To 199
            ' color is as integer, a float gets rounded off by FreeBASIC
            PSet(x, y), Rnd 
        Next
    Next
    c += 1
    fps = c / (Timer - t)
    WindowTitle "fps = " + Str(fps)
 
Wend