Ajout des TP
This commit is contained in:
23
BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO3/exo3.c
Normal file
23
BUT1/DEV1.1/CM2_2/EntrainementDS2/SUJET1 /EXO3/exo3.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user