I have a question about this code. I want to to know how long time this for loop takes by doing as below.
But I will only have second accuracy for start and end.
Is it possible to have milliseconds accuracy instead.
Code:double start; double end; time_t now = time(0); struct tm* tm = localtime(&now); start = tm->tm_sec; for( int i = 0; i < 5000000; i++) { // } time_t now2 = time(0); struct tm* tm2 = localtime(&now2); end = tm2->tm_sec;