0
Ich habe einen Multithread-C-Code für LinkedList geschrieben. Ich versuche, den Durchsatz und die Latenz des Codes zu messen. Für den Durchsatz zu messen, hier ist mein CodeDurchsatz und Latenz eines Codes messen
clock_t begin = clock();
pthread_create (&t1, NULL, thread1, (void *)head);
pthread_create (&t2, NULL, thread2, (void *)head);
pthread_create (&t3, NULL, thread3, (void *)head);
pthread_create (&t4, NULL, thread4, (void *)head);
pthread_join (t1, NULL);
pthread_join (t2, NULL);
pthread_join (t3, NULL);
pthread_join (t4, NULL);
clock_t end = clock();
Und für Latenz ist es als
void * thread1(void * args)
{
clock_t begin = clock();
/* LinkedList Operations */
clock_t begin = clock();
}
Bin folgt ich diese beiden Parameter korrekt messen oder gibt es eine andere Möglichkeit, es zu tun?
Vielen Dank im Voraus!
[dup] (http://stackoverflow.com/a/5249150/5058676) – evaitl