23 lines
341 B
C
23 lines
341 B
C
|
#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;
|
||
|
}
|