Browse Source

micrortps_client_main: remove unnecessary sleep(1);

... and some strange reformatting due to astyle...
sbg
Beat Küng 8 years ago committed by Lorenz Meier
parent
commit
72f9371ca4
  1. 13
      src/modules/micrortps_bridge/micrortps_client/microRTPS_client_main.cpp

13
src/modules/micrortps_bridge/micrortps_client/microRTPS_client_main.cpp

@ -155,23 +155,30 @@ static int micrortps_start(int argc, char *argv[]) @@ -155,23 +155,30 @@ static int micrortps_start(int argc, char *argv[])
return -1;
}
sleep(1);
struct timespec begin;
int total_read = 0;
int total_read = 0, loop = 0;
uint32_t received = 0;
int loop = 0;
micrortps_start_topics(begin, total_read, received, loop);
struct timespec end;
px4_clock_gettime(CLOCK_REALTIME, &end);
double elapsed_secs = double(end.tv_sec - begin.tv_sec) + double(end.tv_nsec - begin.tv_nsec) / double(1000000000);
printf("RECEIVED: %lu messages in %d LOOPS, %d bytes in %.03f seconds - %.02fKB/s\n\n",
(unsigned long)received, loop, total_read, elapsed_secs, (double)total_read / (1000 * elapsed_secs));
delete transport_node;
transport_node = nullptr;
PX4_INFO("exiting");
fflush(stdout);
_rtps_task = -1;

Loading…
Cancel
Save