1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
QueryPerformanceFrequency(&Frequency);
int nb_max = 1 ; //Je l'ai mi a 1 pour cet exemple (->un seul thread)
...
QueryPerformanceCounter(&val2);
HANDLE hThread[nb_max];
unsigned long ThreadId;
for(i=0;i<nb_max;i++)
{
hThread [i] = CreateThread(NULL,NULL,Thread_test,(void *) &voiePID[i], NULL, &ThreadId);
}
WaitForMultipleObjects( // Attente que les threads soient tous initialisés !
nb_max,
hEventsThreadsInit,
TRUE,
INFINITE);
cout<<"\nThreads tous lanc\202s et initialis\202s (WaitForMultipleObjects) !\n";
QueryPerformanceCounter(&val3);
cout <<"# Initialisations des threads en " << (double)(val3.QuadPart-val2.QuadPart)*1000/(double)Frequency.QuadPart<< " millisecondes." << endl; |
Partager