Timer

nem02004 Messages postés 47 Date d'inscription vendredi 21 mai 2004 Statut Membre Dernière intervention 23 avril 2007 - 5 janv. 2006 à 22:07
neodelphi Messages postés 442 Date d'inscription jeudi 4 avril 2002 Statut Membre Dernière intervention 11 août 2008 - 7 janv. 2006 à 07:10
Bonsoir a tous, je voudrais savoir comment faire un timer En gros:

int Test=0;
int main {
TIMER <30 secs> TEST();
sockreceiv(sock);
Test =1;
}

TEST() {
if (Test) { exit(1); }
}

Bon ya des fautes mais c pa slessentiel c juste le principe du timer ke je veux ke je montre ici.

3 réponses

cs_Joky Messages postés 1787 Date d'inscription lundi 22 novembre 2004 Statut Membre Dernière intervention 31 janvier 2009 2
6 janv. 2006 à 09:44
void MyTimerProc(HWND hWnd, UINT Msg, UINT_PTR id, DWORD dwTime)

{

//Opération dans le timer

return;

}



//Pour lancer un Timer

SetTimer(hWnd, ID_TIMER, Time_MilliSeconde, MyTimerProc);
if(!Meilleur("Joky")) return ERREUR;<
0
cs_Joky Messages postés 1787 Date d'inscription lundi 22 novembre 2004 Statut Membre Dernière intervention 31 janvier 2009 2
6 janv. 2006 à 15:45
Ah non ça y'est lol :)

Utilise Sleep( 1000 ) plutot ;)

1000 c'est en millisecondes, donc ça fait 1 seconde ;)

if(!Meilleur("Joky")) return ERREUR;<
0
neodelphi Messages postés 442 Date d'inscription jeudi 4 avril 2002 Statut Membre Dernière intervention 11 août 2008
7 janv. 2006 à 07:10
Ou alors si ça a besoin d'être TRES précis, QueryPerformanceCouner

neodelphi
0
Rejoignez-nous