Click to See Complete Forum and Search --> : Speed and memory: Hot to Measures?
tirilo
February 19th, 2002, 04:02 PM
Hi all,
I have a function. How do I measure:
1) how fast that function works on my processor
2) how much memory it uses.
Thanks
NMTop40
February 20th, 2002, 06:02 AM
In Visual C++ you can do a profile on how much time your program spends in each function. This can be done in release mode as well as debug, and you'll normally want to do it in this mode, as that is how it will be running in real life.
You get two figures - one for how much time it spent in the function itself, and another one accumulating any functions it called, so for that one main() is always the highest. You also get a list of the number of times each function was run.
Note: if Profile is greyed on your version of Visual C++ (it's in the Build menu) it probably means you didn't install that option. It doesn't come with the "standard" install.
The best things come to those who rate
cpitis
February 20th, 2002, 08:06 AM
There is a very powerful application in Rational Suite, called Rational Quantify, which measuresa lot of things (function call number, call graphs, call times, thread execution times, etc.). The setup installs an add-in for Visual Studio 6. It is better that the integrated profiler, but it costs a lot.
To check the memory, you can use the task manager (if under NT, 2000, XP). The utility ProcessViewer, available in Visual Studio Suite can be helpful by providing a lot of data about your process.
NMTop40
February 20th, 2002, 08:48 AM
I should add that I think the profiler also calculates memory use if you want it to.
The best things come to those who rate
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.