News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Optimization Testing

Started by pro3carp3, March 03, 2005, 10:15:33 PM

Previous topic - Next topic

pro3carp3

As a beginner in assembly, I'm not familiar with how to ascertain the timings or clock cycles.  I was hoping I could obtain a template which would allow me to insert my code, or insert the template code before & after the section to be tested.

Any suggestions?

Thanks.
LGC

OceanJeff32

I just found a great timing function you have to use Windows API:

GetTickCount()

You could call GetTickCount(), then run your code that you want to time, then call GetTickCount() and see how many ticks passed.

Hope that helps.

Jeff C
:U

P.S. I got the idea from Optimizing Visual C++ with Assembly Code (forgot the author's name at the moment).
Any good programmer knows, every large and/or small job, is equally large, to the programmer!

AeroASM

Go to the laboratory and find MichaelW's code timing macros.

Petroizki

OceanJeff32,

GetTickCount is bad for timing, it is not high interval timer, and depending on OS, it is usually updated like every 10ms..
On C++ code you should use something like QueryPerformanceCounter to get more accurare results.