mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 01:04:19 +08:00
micrortps_client_main: remove unnecessary sleep(1);
... and some strange reformatting due to astyle...
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user