SAE11_2023/src/timer.c

28 lines
568 B
C
Raw Normal View History

2023-12-02 10:13:12 +01:00
#include<stdio.h>
#include<stdlib.h>
#include<graph.h>
2023-12-05 21:22:05 +01:00
void afficher_timer(void){
EcrireTexte(0,0,coucou,2);
}
2023-12-02 10:13:12 +01:00
void creer_timer(void){
2023-12-02 17:21:07 +01:00
int sec = 0,mil_sec=0,min=0;
unsigned long temps = 0,t1=0;
t1=Microsecondes();
2023-12-05 21:22:05 +01:00
while(min<=12){
printf("[%0.2d:%0.2d]\n",min,sec);
temps=Microsecondes()-t1;
2023-12-02 17:21:07 +01:00
min=(temps/60000000)%60;
temps=temps%60000000;
sec=(temps/1000000)%60;
2023-12-05 21:22:05 +01:00
EcrireTexte();
2023-12-02 10:13:12 +01:00
}
}
int main(void){
InitialiserGraphique();
creer_timer();
FermerGraphique();
2023-12-02 17:21:07 +01:00
return EXIT_SUCCESS;
2023-12-02 10:13:12 +01:00
}