Created
May 22, 2020 18:00
-
-
Save hiiamboris/6b77a58ae549b6af413b494a416b3b01 to your computer and use it in GitHub Desktop.
Time redraw of an image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [needs: view] ;) run as `red --cli ...` to eliminate GUI console influence! | |
img: make image! 2000x1000 ;) need a big enough image | |
system/view/auto-sync?: no ;) disable auto-update so we can profile it | |
view [ | |
panel [ | |
base font-color black "CHASE THE MOUSE AROUND" 1000x500 img | |
all-over on-over [ | |
t0: now/precise | |
face/image/(10x10): random white ;) update the image | |
show face/parent ;) then force redraw | |
; show face ;) this one reports false time 0-1 ms while being just as slow! | |
print [to float! 1000.0 * difference now/precise t0 "ms to redraw"] | |
] | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment