update test timings for writer
[urcu.git] / test_urcu_timing.c
index 5065891a50af55b7bb10e9d1a788020f19a3bbbd..6b4aac8b12de0aeaf2f317c6408cc19d37be7d74 100644 (file)
@@ -140,8 +140,8 @@ void *thr_writer(void *arg)
        sleep(2);
 
        for (i = 0; i < OUTER_WRITE_LOOP; i++) {
-               time1 = get_cycles();
                for (j = 0; j < INNER_WRITE_LOOP; j++) {
+                       time1 = get_cycles();
                        new = malloc(sizeof(struct test_array));
                        rcu_copy_mutex_lock();
                        old = test_rcu_pointer;
@@ -156,10 +156,10 @@ void *thr_writer(void *arg)
                                old->a = 0;
                        }
                        free(old);
+                       time2 = get_cycles();
+                       writer_time[(unsigned long)arg] += time2 - time1;
+                       usleep(1);
                }
-               time2 = get_cycles();
-               writer_time[(unsigned long)arg] += time2 - time1;
-               usleep(1);
        }
 
        printf("thread_end %s, thread id : %lx, tid %lu\n",
This page took 0.022054 seconds and 4 git commands to generate.