| |
|
|
p.specht
| Jens-Arne Reumschüssel found moreover a Solution, The without API-Fummelei auskommt and a deutliche Beschleunigung sowohl in the Interpreter as well as Compiler bring. moreover here my small Benchmark.
Window Title "Messageabholendes Waitinput speed:"+\
" Solution of Jens-Arne Reumschüssel testen"
CLS:Randomize:font 2
declare n&,tm&,i&,x&,y&,txt$,ungueltig&
$IFNDEF COMPILER
txt$="INTERPRETER"
n&=2500
$ELSE
txt$="COMPILER"
n&=4000
$ENDIF
AppendMenuBar 100," "+txt$+" counts To "+st$(n&)+\
". ESC-Button should recognized and be destroy whom ongoing Test!"
print "\n OHNE Beschleunigung:",:x&=%pos:y&=%csrlin
waitinput 3:sound 200,20:ungueltig&=0
tm&=&GetTickCount
Whileloop n&:locate 20,20:print &Loop;" ";
i&=&Loop
waitinput 3
if %Key="27":ungueltig&=1:break:endif
Endwhile
tm&=&GetTickCount-tm&
locate y&,x&
ifnot ungueltig&: print tm&,"ms"
else :print "<abgebrochen>":clear ungueltig&
Endif
print "\n ONLY Fastmode:",:x&=%pos:y&=%csrlin
waitinput 3:sound 200,20:ungueltig&=0
tm&=&GetTickCount
set("Fastmode",1)
Whileloop n&:locate 20,20:print &Loop;" ";
waitinput 3
if %Key="27":ungueltig&=1:break:endif
Endwhile
set("Fastmode",0)
tm&=&GetTickCount-tm&
locate y&,x&
ifnot ungueltig&: print tm&,"ms"
else :print "<abgebrochen>":clear ungueltig&
Endif
print "\n ONLY MIT rnd()-chance:",:x&=%pos:y&=%csrlin
waitinput 3::sound 200,20:ungueltig&=0
tm&=&GetTickCount
Whileloop n&:locate 20,20:print &Loop;" ";
if rnd()>0.95
waitinput 3
if %Key="27":ungueltig&=1:break:endif
endif
Endwhile
tm&=&GetTickCount-tm&
locate y&,x&
ifnot ungueltig&: print tm&,"ms"
else :print "<abgebrochen>":clear ungueltig&
Endif
print "\n LÖSUNG of Jens-Arne R.: Fastmode with %PeekMessage:",:x&=%pos:y&=%csrlin
waitinput 3:sound 200,20:ungueltig&=0
tm&=&GetTickCount
set("Fastmode",1)
Whileloop n&:locate 20,20:print &Loop;" ";
if %PeekMessage
waitinput 3
if %Key="27":ungueltig&=1:break:endif
Endif
Endwhile
set("Fastmode",0)
tm&=&GetTickCount-tm&
locate y&,x&
ifnot ungueltig&: print tm&,"ms"
else :print "<abgebrochen>":clear ungueltig&
Endif
print "\n OHNE EACH ABFRAGE:",:x&=%pos:y&=%csrlin
waitinput 3:sound 200,20:ungueltig&=0
tm&=&GetTickCount
Whileloop n&:locate 20,20:print &Loop;" ";
Endwhile
tm&=&GetTickCount-tm&
locate y&,x&
ifnot ungueltig&: print tm&,"ms"
else :print "<abgebrochen>":clear ungueltig&
Endif
hold:
sound 2000,60
Waitinput 7000:casenot %wmtimer:goto "hold"
END
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/29/21 ▲ |
|
|
|