I explained in the forums an easy method for determining the speed of a C/C++ function. Just include the following function into your project file:
long getExecutionTime(void (*func)()); // define Function
long GetExecutionTime(void (*func)()){
long cTick, nTick;
cTick = GetTickCount();
(*func)();
nTick = GetTickCount();
return nTick - cTick;
}
Then use the function by passing in the function name into GetExecutionTime, for example:
void doSleep(){
Sleep(5000);
}
int main(int argc, char *argv[])
{
cout << "Code executed in: " << GetExecutionTime(doSleep) << "ms \n";…

Home
Projects
Hosting
Advertising
About
Archive
Contact
Forums
Subscribe