Fix timer
This commit is contained in:
BIN
evenement.o
BIN
evenement.o
Binary file not shown.
26
test.c
26
test.c
@@ -1,26 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
void afficherTemps(double secondes) {
|
|
||||||
int minutes = (int)(secondes / 60);
|
|
||||||
int secondesRestantes = (int)(secondes) % 60;
|
|
||||||
|
|
||||||
printf("%02d:%02d\n", minutes, secondesRestantes);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
time_t start, end;
|
|
||||||
double cpu_time_used;
|
|
||||||
|
|
||||||
start = time(NULL);
|
|
||||||
|
|
||||||
end = time(NULL);
|
|
||||||
|
|
||||||
cpu_time_used = difftime(end, start);
|
|
||||||
|
|
||||||
printf("Le programme a pris : ");
|
|
||||||
afficherTemps(cpu_time_used);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Reference in New Issue
Block a user