My favorite approach to measure performance of my code in AX is WinAPI::getTickCount() method. I find it as the most precise and simple way to do a quick measurement. Code profiler measures performance quite well, however it takes much more time to get the results.
How do you measure performance of your code in AX?
timeInterval = WinAPI::getTickCount();
timeInterval = WinAPI::getTickCount() - timeInterval;