My program multiplies two numbers given by the user. I would like to see how the time required to do so increases as the numbers increase, so i may plot the working capacity of my laptop processor. Is there a built in function i can use?
I don't have code on me (at work) for the clock. But if you drop me an email to public01 _at_ zaita.com I can reply with some code once I get home from work.
As for the tickcount.
1 2 3 4 5 6 7 8 9 10 11
#include <windows.h>
int main() {
int iStartTime = GetTickCount();
// Do Stuff
int iEndTime = GetTickCount();
int iDiff = iEndTime - iStartTime;
cout << "Took " << iDiff << "ms" << endl;
return 0;
}
I am running the code on Windows XP. Can you tell me how to make the simple version work as i do not want my code to become cluttered. Could you also post the Frequency Clock method once u have time? Thanks
I'm not sure if this will help as precisely as you like, but a simple way would be to use the time.h library. I don't know what wouldn't make it precise, but, then, I'm no expert yet. ;P''
I know one of those functions returns time elapsed since program start til the function call, and there are others that can be used to get the differences of time.