Buchempfehlung
Windows System Programming
Windows System Programming
Das Kompendium liefert viele interessante Informationen zur Windows-Programmierung auf Englisch. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

Tutorial

Ausführungsgeschwindigkeit bestimmen

von RedakteurytwinkySeite 2 von 3

Klar doch:

#include once "windows.bi"
#include "counter.bas"
Const sf="######", wo=17, LoopCounterValue=2000
Dim As uInt i, y=2, z = 3
Dim As Double d, d2=Atn(1)
Dim As String s="Gallia est omnis divisa in partes tres..", c
Print "Befehl";Tab(wo+1);" Zyklen"
Counter_Begin (LoopCounterValue, HIGH_PRIORITY_CLASS)
i=1
counter_end
Print "i = 1";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=i+2
counter_end
Print "i = i + 2";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i+=2
counter_end
Print "i+= 2";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=i * 3
counter_end
Print "i = i * 3";:?Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i*=3
counter_end
Print "i*= 3";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=i*4
counter_end
Print "i = i * 4";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i*=4
counter_end
Print "i*= 4";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=i/3
counter_end
Print "i = i / 3";:Print Tab(Wo);:Print Using sf$;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i/=3
counter_end
Print "i/= 3";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=i/4
counter_end
Print "i = i / 4";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i/=4
counter_end
Print "i/= 4";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=i\3
counter_end
Print "i = i \ 3";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i\=3
counter_end
Print "i\= 3";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=i\4
counter_end
Print "i = i \ 4";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i\=4
counter_end
Print "i\= 4";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=y/z
counter_end
Print "i = y / z";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=y\z
counter_end
Print "i = y \ z";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=y mod z
counter_end
Print "i = y mod z";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
d=d2^z
counter_end
Print "d = y ^ z";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
d=d2*d2*d2
counter_end
Print "d = y * y * y";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
d=d2^3
counter_end
Print "d = y ^ 3";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
i=sqr(y)
counter_end
Print "i = sqr(y)";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
d=sin(d2)
counter_end
Print "d = sin(d2)";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
c=s[0]
counter_end
Print "c = s[0]";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
c=Mid(s, 1, 1)
counter_end
Print "c = Mid(s, 1, 1)";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
c=Left(s, 1)
counter_end
Print "c = Left(s, 1)";:Print Tab(Wo);:Print Using sf;counter_cycles

counter_begin(LoopCounterValue, HIGH_PRIORITY_CLASS)
c=Right(s, 1)
counter_end
Print "c = Right(s, 1)";:Print Tab(Wo);:Print Using sf;counter_cycles;
sleep

Genauso, wie wir es beim Timer gemacht haben, müssen wir es bei Counter.bas auch machen:

 

Gehe zu Seite Gehe zu Seite  1  2  3  
Zusätzliche Informationen und Funktionen
  • Das Tutorial wurde am 22.08.2007 von Redakteurytwinky angelegt.
  • Die aktuellste Version wurde am 11.06.2012 von Redakteurytwinky gespeichert.
  Bearbeiten Bearbeiten  

  Versionen Versionen