problème du timer partiellement réglé : segmentation fault en fin de progamme

This commit is contained in:
Marco ORFAO 2023-12-03 12:24:53 +01:00
parent 438547e390
commit a27bd419b4

View File

@ -4,16 +4,14 @@
void creer_timer(void){ void creer_timer(void){
int sec = 0,mil_sec=0,min=0; int sec = 0,mil_sec=0,min=0;
unsigned long temps = 0; unsigned long temps = 0,t1=0;
printf("temps : %lu\n",temps); t1=Microsecondes();
while(min<=2){ while(sec<=12){
printf("[%d:%d,%d]\n",min,sec,mil_sec); printf("[%0.2d:%0.2d]\n",min,sec);
temps=Microsecondes(); temps=Microsecondes()-t1;
printf("temps : %lu\n",temps);
sec=(temps/1000000)%60;
mil_sec=(temps/1000)%101;
min=(temps/60000000)%60; min=(temps/60000000)%60;
printf("[%d:%d,%d]\n",min,sec,mil_sec); temps=temps%60000000;
sec=(temps/1000000)%60;
} }
} }