English
Source / code snippets

Zeitbedarf for Message-abholendes Waitinput heavy reduce (Benchmark)

 

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 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/29/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.473 Views

Untitledvor 0 min.
H.Brill05/07/24
RudiB.03/07/22
p.specht11/21/21
R.Schneider11/20/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie