I did some further testing and investigation.
dedndave gave me his counter template, and I ran a shoot-out test
between his template and mine. Here are the results...
dedndaves...
10 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
15 - dedndaves counter template
And the exact template used in the comparison:
.XCREF
.NoList
INCLUDE \Masm32\Include\Masm32rt.inc
.686p
.MMX
.XMM
INCLUDE \Masm32\Macros\Timers.asm
.List
Loop_Count = 50000000 ; adjusted for ~~ .5 seconds on my machine
.DATA
.DATA?
.CODE
main PROC
INVOKE GetCurrentProcess
INVOKE SetProcessAffinityMask, eax, 1
INVOKE Sleep, 750
mov ecx, 10
Loop00: push ecx
counter_begin Loop_Count, HIGH_PRIORITY_CLASS
; ------------------------------------------------------------------------------
xor ebx, ebx
@@:
inc ebx
cmp ebx, 10
jnz @b
@@:
; ------------------------------------------------------------------------------
counter_end
print str$(eax), 32, " - dedndaves counter template"
print chr$(13, 10)
pop ecx
dec ecx
jnz Loop00
inkey
INVOKE ExitProcess, 0
main ENDP
heavyload proc
ret
heavyload endp
END main
mine... I modified mine to repeat only 16 times.
17 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
15 average cycles - 16 reps - zedds counter
And the exact template used for the comparison:
include \masm32\include\masm32rt.inc
.686
include \masm32\macros\timers.asm
.data
ctx dd 0
loopctr dd 0
.code
start:
mov loopctr, 10 ; how many indidual test to be printed
top:
mov ctx, 0
repeat 16 ; repititions in test
invoke Sleep, 1
counter_begin 2800000, HIGH_PRIORITY_CLASS ; value adjusted for stability
; ------------------------------------------------------------------------------
xor ebx, ebx
@@:
inc ebx
cmp ebx, 10
jnz @b
@@:
; ------------------------------------------------------------------------------
counter_end
add ctx, eax
endm
mov eax, ctx
shr eax, 4
print str$(eax), 20h, "average cycles - 16 reps - zedds counter", 10, 13
dec loopctr
cmp loopctr, 0
jg top
inkey
exit
end start
I still think that majority rules. Even in some of the other 'cycle counting' threads,
there are some anomalies on either side of the majority count value.
I would be interested if a few other members would run the same two tests as posted on their
machines and post their results. Would be appreciated.
I know I'm just a new guy, but I could be onto something.