Skip to content
Snippets Groups Projects
Commit cd66e6fd authored by horstmannmat's avatar horstmannmat
Browse files

tempo

parent 6937d6ac
No related branches found
No related tags found
No related merge requests found
#include<time.h>
#include<stdio.h>
int tempoEmMili(clock_t inicio, clock_t fim);
void main(){
/* ti = Tempo Inicial
tf = Tempo Final*/
clock_t ti, tf;
//tt = Tempo Total em milisegundos
int tt;
ti = clock();
tf = clock();
tt=tempoEmMili(ti,tf);
printf("Tempo em mili: %d\n", tt);
}
int tempoEmMili(clock_t inicio, clock_t fim){
double tt;
tt = (((fim-inicio)*100000)/CLOCKS_PER_SEC);
return tt;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment