Created
April 9, 2013 10:52
-
-
Save 3runo5ouza/5344794 to your computer and use it in GitHub Desktop.
Para verificar o tempo de execução de um programa ou uma parte de um programa.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//BIBLIOTECA | |
#include <time.h> | |
//VARIAVEIS | |
clock_t inicio, fim; | |
double tempoGasto; | |
//ANTES DO PROCESSO | |
inicio = clock(); | |
//o processo q se quer medir fica aqui | |
//DEPOIS DO PROCESSO | |
fim = clock(); | |
tempoGasto = (double)(fim - inicio) / CLOCKS_PER_SEC; | |
//MOSTRA | |
printf("\nTempo de execucao: %f", tempoGasto); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment