QueryPerformanceFrequency
(_OFFSET(Frequency
)) '***QueryPerformanceCounter
(_OFFSET(StartingCount
)) '***CumulativeTime#=0 '***
TestLimit = 100
Radius = 350
'Cls , &HFF000000 + Int(Rnd * &HFFFFFF)
k&
= &HFF000000 + Int(Rnd * &HFFFFFF)
Fill 512, 360, k&, 0
CumulativeTime_T1_T#=CumulativeTime# '***
CumulativeTime#=0 '***
'Cls , &HFF000000 + Int(Rnd * &HFFFFFF)
k&
= &HFF000000 + Int(Rnd * &HFFFFFF)
Fill 512, 360, k&, -1
CumulativeTime_T2_T1#=CumulativeTime# '***
Print Using "###.#### seconds for Fill."; t1#
- t#;
print " microseconds to DIM array" '***
Print Using "###.#### seconds for Fill Method -1."; t2#
- t1#;
print " microseconds to DIM array" '***
Sub Fill
(Passx
, Passy
, kolor
As Long, METHOD
)
TIMERe:dElapsedTimeOLD = dElapsedTime '***
TIMERe '***
CumulativeTime#=CumulativeTime#+(dElapsedTime - dElapsedTimeOLD)*1000000 '***
o = 0
'Else
'_MemPut m, m.OFFSET + o, 0 As LONG
o = o + 4
TempGrid(Passx, Passy) = 1
startx = Passx: finishx = Passx
starty = Passy: finishy = Passy
pass = pass + 1
finished = -1
For x
= startx
To finishx
For y
= starty
To finishy
'If TempGrid(x, y) <> 0 Then Print x, y, TempGrid(x, y): Sleep
tempx = x
If TempGrid
(tempx
- 1, y
) = 0 Then TempGrid(tempx - 1, y) = pass + 1
tempx = tempx - 1
If tempx
< startx
Then startx
= tempx
finished = 0
tempx = 0
tempx = x
If TempGrid
(tempx
+ 1, y
) = 0 Then TempGrid(tempx + 1, y) = pass + 1
tempx = tempx + 1
If tempx
> finishx
Then finishx
= tempx
finished = 0
tempy = y
If TempGrid
(x
, tempy
- 1) = 0 Then TempGrid(x, tempy - 1) = pass + 1
tempy = tempy - 1
If tempy
< starty
Then startx
= tempy
finished = 0
tempy = 0
tempy = y
If TempGrid
(x
, tempy
+ 1) = 0 Then TempGrid(x, tempy + 1) = pass + 1
tempy = tempy + 1
If tempy
> finishy
Then finishy
= tempy
finished = 0
o = 0
o = o + 4
'***
QueryPerformanceCounter
(_OFFSET(PerformanceCount
)) '***dElapsedTime
= (CDBL(PerformanceCount
- StartingCount
)) / Frequency
'***