I did a code to multiply two matrixes. I don't know how to measure (seconds) that the operation gets. Thanks if someone can help me. :rolleyes: The code:
(thanks Zadkiel for instructions) :)
.data ;~~~~~~~~~~~~~~Data section pA QWORD 1.5,2.5,3.5 QWORD 1.7,2.7,3.7 QWORD 1.9,2.9,3.9 pB QWORD 5.1,5.2,5.3 QWORD 7.1,7.2,7.3 QWORD 9.1,9.2,9.3 .code ;~~~~~~~~~~~~~~Code section (A <- A x B) lea edi,pA lea esi,pB finit mov eax,3 nxtrow: mov ecx,3 nxtcol: fld QWORD PTR fmul QWORD PTR fld QWORD PTR  fmul QWORD PTR  fadd fld QWORD PTR  fmul QWORD PTR  fadd add esi,8 dec ecx jnz nxtcol fstp QWORD PTR  fstp QWORD PTR  fstp QWORD PTR sub esi,24 add edi,24 dec eax jnz nxtrow
GetTickCount before and after. Then sub the first return value from the last. Actually it's quite inaccurate. You need clocks or High perform timer. I post ~ 15 times how to do it. Hope someone else would anwered the posted ready code.
Svin's right, I made a macro set out of Svin's clocking code...
TESTCLOCKS_ON MACRO db 0fh,31h push edx ; push high push eax ; push low ENDM TESTCLOCKS_OFF MACRO db 0fh,31h pop ebx ; pop low pop ecx ; pop hight sub eax,ebx ; diff low sbb edx,ecx ; diff high ENDM
I use it in a while loop, because i found the first time threw on my machine gives a largely delayed numbers (dont know why...) but on the second and third repitions it produces useable stats.. NaN
TESTCLOCKS_ON ; test code goes here TESTCLOCKS_OFF ; 64 bit number of the # of clocks taken by the cpu... (EDX:EAX)
Guys, the technique I use for clocking algorithms is based on the problems of ring3 interference. RDTSC has very high resolution but it suffers from the same interference that and ring3 code does, lower priority that OS code. GetTickCount() has a nominal 1 millisecond resolution so it is of little use for short intervals but if you set up the code you are testing so that it runs for over 500 milliseconds, the error percentage starts to become very low. It is a convenient way to repeatedly test and algorithm which you are changing regularly and once the sample size is big enough, the accuracy is good enough. Regards, firstname.lastname@example.org
I'll say the same words as you did but in different order. GetTickCount the same interference as RDTSC. But RDTSC has much better resolution. So RDTSC is much more precize. Actually with short test 20 millisec is long enough to run loop with short algo many times. And if you don't move and click at the time and have no progs running there threads you'll get quite accurate result. And you can change slice size to 60 millisecs that will do even better. The Svin.