Fix timer
This commit is contained in:
parent
04623f82ec
commit
86edacfb9f
BIN
evenement.o
BIN
evenement.o
Binary file not shown.
BIN
main.o
BIN
main.o
Binary file not shown.
BIN
prog
BIN
prog
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user