1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
clock_t start = clock();
struct timeval tv;
int ret = gettimeofday(&tv, 0);
int script_start= tv.tv_usec;
//moncode
ret = gettimeofday(&tv, 0);
int script_end= tv.tv_usec;
printf("Temps d'execution : %f secondes\n", ( (double) script_end - (double) script_start ) / CLOCKS_PER_SEC );
printf("Time elapsed: %f\n", ((double)clock() - (double)start) / CLOCKS_PER_SEC);
printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
cout << "Temps d'execution :"<< script_end - script_start<< " microsecondes"<<endl; |
Partager