|
Post by sarossell on Mar 5, 2020 18:52:11 GMT -5
I finally opted for the timer solution. It appears to be the most compact, reliable and mainstream solution. And it doesn't suffer the complications of having to use flush.
' Timer example.
[START] nomainwin WindowWidth = 300 WindowHeight = int(WindowWidth*.618) UpperLeftX = int((DisplayWidth-WindowWidth)/2)-250 UpperLeftY = int((DisplayHeight-WindowHeight)/2) open "Loop Tests" for graphics as #main #main, "font courier_new 36 bold" print #main, "trapclose [FINISH]" [again] tt=time$("seconds") for n = 1 to 5 #main, "place 100 100" #main, "\";n ' Compact timer function: '/------------------------------\ timer 3000,[z]:wait:[z]timer 0 '\------------------------------/ next total=time$("seconds")-tt notice "Total time: "+str$(total)+" seconds." #main, "cls" goto [again] [FINISH] close #main end
|
|
|
Post by Carl Gundel on Mar 5, 2020 21:35:35 GMT -5
It’s actually the use of cls that obviates the need for flush. But you either need to cls as you’re doing, or else use discard or delsegment. If you only flush each time you will consume more and more memory.
|
|
|
Post by sarossell on Mar 6, 2020 3:01:40 GMT -5
If you only flush each time you will consume more and more memory. Huh, I did not know that. Good to know. Thanks! :@)
|
|