DEV/BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO3/exo3.c

23 lines
341 B
C
Raw Normal View History

2024-02-01 13:55:03 +01:00
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
#include <math.h>
int main(void){
int i;
struct timeval tv1;
struct timeval tv2;
gettimeofday(&tv1,NULL);
for(i=0;i<1000000;i++){
sqrt(2);
}
gettimeofday(&tv2,NULL);
printf("%dμs",tv2.tv_usec-tv1.tv_usec);
return EXIT_SUCCESS;
}