19 lines
553 B
Text
19 lines
553 B
Text
link printf
|
|
|
|
procedure main()
|
|
&window := open("B&W noise 320x240","g","size=320,240","bg=white","fg=black") |
|
|
stop("Open window failed ")
|
|
runtime := 10 # seconds to run
|
|
sec := &now
|
|
frames := 0
|
|
until (&now - sec) >= runtime do {
|
|
s := "320,#"
|
|
every 1 to 240 & 1 to 320/4 do s ||:= ?"0123456789ABCDEF"
|
|
DrawImage(0,0,s)
|
|
frames +:= 1
|
|
}
|
|
sec := &now - sec
|
|
printf("frames=%d, elapsed time=%r, fps=%r\n",frames,sec, frames/real(sec))
|
|
Event() # wait for any window event
|
|
close(&window)
|
|
end
|