i'm try to make a comparison between the speed of sorting methods, and i've been using this one
#include <stdio.h>
#include <time.h>
int main ()
{
time_t seconds;
time_t seconds1;
time_t realTime;
seconds = time (NULL);
Sorting method
seconds1 = time (NULL);
realTime = seconds1 - seconds;
cout << "This method took "<< realTime << " sec";
return 0;
}
Problem is that i need the measurments to be very accurate in milliseconds or even microseconds and this will only measure the time in seconds. So the question is, do u guys know a c++ that measures time in milliseconds or microseconds and how do i use it?
Question
Darko3d
i'm try to make a comparison between the speed of sorting methods, and i've been using this one
#include <stdio.h> #include <time.h> int main () { time_t seconds; time_t seconds1; time_t realTime; seconds = time (NULL); Sorting method seconds1 = time (NULL); realTime = seconds1 - seconds; cout << "This method took "<< realTime << " sec"; return 0; }Problem is that i need the measurments to be very accurate in milliseconds or even microseconds and this will only measure the time in seconds. So the question is, do u guys know a c++ that measures time in milliseconds or microseconds and how do i use it?
i'm using visual studio 2008 btw
Link to comment
Share on other sites
12 answers to this question
Recommended Posts