I will tell you int's will be faster than floats/doubles. And doubles will be faster than floats. But to answer your question yes, you can use ctime header. Here is an example:
#include <iostream>
#include <ctime>
int main(){
time_t startTime = clock();
/* code to test goes here */
time_t endTime = clock();
cout << "Difference in time(milliseconds) : " << endTime - startTime << endl;
}
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
I guess you can try the standard functions like sin or cos or tan or sqrt and so on.
If you looking to win the fair/project then you might want to think of something else because comparing operations aren't so valuable or useful.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608