1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
int fonction
{
time_t heure_depart;
heure_depart = time(NULL);
time_t actuel;
actuel = time (NULL);
time_t actuel_interne,heure_depart_interne;
actuel_interne = time (NULL);
heure_depart_interne = time(NULL);
while(1)
{
while(difftime(actuel,heure_depart)<300)
{
time_t actuel_interne,heure_depart_interne;
actuel_interne = time (NULL);
heure_depart_interne = time(NULL);
while(difftime( actuel_interne, heure_depart_interne)<20)
{
cout<<"affichage toutes les 20 secondes"<<endl;
actuel_interne = time(NULL);
}
cout<<"affichage toutes les 5 minutes"<<endl;
Beep(1000,300);
heure_depart_interne = time(NULL);
actuel_interne = time(NULL);
}
Envoi_System_Code_Sync();
Beep(300,1000);
heure_depart = time(NULL);
actuel = time(NULL);
}
} |