Const n=1000
For i=1 To 10000
MegaFunc()
Next
gh=MilliSecs()
SeedRnd gh
a=MilliSecs()
h=0
For i=1 To n
If (i Mod 3 = 2 ) And MegaFunc()=1 Then h=h+1
Next
Print "h="+Str(h)+"1:"+Str(MilliSecs()-a)
SeedRnd gh
a=MilliSecs()
h=0
For i=1 To n
If MegaFunc()=1 And (i Mod 3 = 2 ) Then h=h+1
Next
Print "h="+Str(h)+"2:"+Str(MilliSecs()-a)
SeedRnd gh
a=MilliSecs()
h=0
For i=1 To n
If (i Mod 3 = 2 )
If MegaFunc()=1 Then h=h+1
EndIf
Next
Print "h="+Str(h)+"3:"+Str(MilliSecs()-a)
SeedRnd gh
a=MilliSecs()
h=0
For i=1 To n
If (MegaFunc()=1)
If i Mod 3 = 2 Then h=h+1
EndIf
Next
Print "h="+Str(h)+"4:"+Str(MilliSecs()-a)
Function MegaFunc()
s#=2
For i=1 To 100
s#=s+s^s*Sin(s)-(Sqr(Cos(s)+Tan(s))-1.618)^2
Next
Return Rand(0,1)
End Function
WaitKey