|
@@ -276,8 +276,8 @@ static void route_clients_test(NetIO &netio)
|
|
|
unsigned long end = epoch_clients(netio);
|
|
|
|
|
|
clock_gettime(CLOCK_REALTIME_COARSE, &tp);
|
|
|
- //unsigned long end_post_pc = tp.tv_sec * 1000000 + tp.tv_nsec/1000;
|
|
|
- //unsigned long diff_post_pc = end_post_pc - start;
|
|
|
+ unsigned long end_post_pc = tp.tv_sec * 1000000 + tp.tv_nsec/1000;
|
|
|
+ unsigned long diff_post_pc = end_post_pc - end;
|
|
|
//printf("Epoch end_post_pc time = %lu\n", end_post_pc);
|
|
|
//printf("Epoch diff_post_pc time = %lu\n", diff_post_pc);
|
|
|
|
|
@@ -288,9 +288,7 @@ static void route_clients_test(NetIO &netio)
|
|
|
|
|
|
struct timeval now;
|
|
|
gettimeofday(&now, NULL);
|
|
|
- remaining_us = epoch_interval
|
|
|
- - (now.tv_sec - epoch_start.tv_sec) * 1000000
|
|
|
- - (now.tv_usec - epoch_start.tv_usec);
|
|
|
+ remaining_us = epoch_interval - diff_post_pc;
|
|
|
|
|
|
// Sleep for the rest of the epoch interval
|
|
|
printf("%lu.%06lu: Sleeping for %ld us\n", now.tv_sec,
|