- Raissa Papini
- Mensagens : 12
Data de inscrição : 12/04/2017
Tempo de execução dos algoritmos
Sex Jun 02 2017, 18:18
// importar
#include <time.h>
#include <windows.h>
// declarar como variável
LARGE_INTEGER tempoInicial, tempoFinal, freq;
float tempoTotal;
//Colocar logo antes de começar o for
QueryPerformanceCounter(&tempoInicial);
//Colocar logo depois de terminar o for
QueryPerformanceCounter(&tempoFinal);
QueryPerformanceFrequency(&freq);
tempoTotal = (float)(tempoFinal.QuadPart - tempoInicial.QuadPart)/freq.QuadPart;
printf("\n\nTempo total: %f",tempoTotal);
#include <time.h>
#include <windows.h>
// declarar como variável
LARGE_INTEGER tempoInicial, tempoFinal, freq;
float tempoTotal;
//Colocar logo antes de começar o for
QueryPerformanceCounter(&tempoInicial);
//Colocar logo depois de terminar o for
QueryPerformanceCounter(&tempoFinal);
QueryPerformanceFrequency(&freq);
tempoTotal = (float)(tempoFinal.QuadPart - tempoInicial.QuadPart)/freq.QuadPart;
printf("\n\nTempo total: %f",tempoTotal);
Permissões neste sub-fórum
Não podes responder a tópicos
|
|