#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void dealTime(struct timeval tpstart, struct timeval tpend){
double time_use;
time_use = 1000000 * (tpend.tv_sec - tpstart.tv_sec) + tpend.tv_usec - tpstart.tv_usec;
time_use /= 1000000;
printf("time used: %lf s \n", time_use);
}
void function(){
int i, j;
for (i = 1; i < 54000; i++)
for( j = 0; j < 1000; j++)
;
}
int main(){
struct timeval time_start, time_end;
gettimeofday(&time_start, NULL);
function();
gettimeofday(&time_end, NULL);
dealTime(time_start, time_end);
}
~
~
~
~
~
~ #include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void dealTime(struct timeval tpstart, struct timeval tpend){
double time_use;
time_use = 1000000 * (tpend.tv_sec - tpstart.tv_sec) + tpend.tv_usec - tpstart.tv_usec;
time_use /= 1000000;
printf("time used: %lf s \n", time_use);
}
void function(){
int i, j;
for (i = 1; i < 54000; i++)
for( j = 0; j < 1000; j++)
;
}
int main(){
struct timeval time_start, time_end;
gettimeofday(&time_start, NULL);
function();
gettimeofday(&time_end, NULL);
dealTime(time_start, time_end);
}
~
~
~
~
~
~ #include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void dealTime(struct timeval tpstart, struct timeval tpend){
double time_use;
time_use = 1000000 * (tpend.tv_sec - tpstart.tv_sec) + tpend.tv_usec - tpstart.tv_usec;
time_use /= 1000000;
printf("time used: %lf s \n", time_use);
}
void function(){
int i, j;
for (i = 1; i < 54000; i++)
for( j = 0; j < 1000; j++)
;
}
int main(){
struct timeval time_start, time_end;
gettimeofday(&time_start, NULL);
function();
gettimeofday(&time_end, NULL);
dealTime(time_start, time_end);
}
~
~
~
~
~
~ #include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void dealTime(struct timeval tpstart, struct timeval tpend){
double time_use;
time_use = 1000000 * (tpend.tv_sec - tpstart.tv_sec) + tpend.tv_usec - tpstart.tv_usec;
time_use /= 1000000;
printf("time used: %lf s \n", time_use);
}
void function(){
int i, j;
for (i = 1; i < 54000; i++)
for( j = 0; j < 1000; j++)
;
}
int main(){
struct timeval time_start, time_end;
gettimeofday(&time_start, NULL);
function();
gettimeofday(&time_end, NULL);
dealTime(time_start, time_end);
}
~
~
~
~
~
~ #include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
void dealTime(struct timeval tpstart, struct timeval tpend){
double time_use;
time_use = 1000000 * (tpend.tv_sec - tpstart.tv_sec) + tpend.tv_usec - tpstart.tv_usec;
time_use /= 1000000;
printf("time used: %lf s \n", time_use);
}
void function(){
int i, j;
for (i = 1; i < 54000; i++)
for( j = 0; j < 1000; j++)
;
}
int main(){
struct timeval time_start, time_end;
gettimeofday(&time_start, NULL);
function();
gettimeofday(&time_end, NULL);
dealTime(time_start, time_end);
}
~
~
~
~
~