From 813a2cb44321af4667f706d00ddc9211f123af8c Mon Sep 17 00:00:00 2001 From: brutzman <brutzman@DESKTOP-2S09UKA> Date: Thu, 1 Jul 2021 08:05:59 -0700 Subject: [PATCH] note timing in output log --- examples/DisDemo/build.run.log.txt | 4 ++-- examples/DisDemo/src/disdemo/DisDemo.java | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/DisDemo/build.run.log.txt b/examples/DisDemo/build.run.log.txt index 9268b0ef69..32cd48707c 100644 --- a/examples/DisDemo/build.run.log.txt +++ b/examples/DisDemo/build.run.log.txt @@ -8,7 +8,8 @@ warning: [options] system modules path not set in conjunction with -source 11 1 warning compile: run: -Sending 20 ESPDU packets on broadcast address=[/192.168.1.255] port 3000 +Sending 20 ESPDU packets at 1000 msec (1.0 second) intervals on + broadcast address=[/172.20.209.165, /172.16.0.255] port 3000 Current position: 0.0, 1.0, 0.0 ... sent 1 Current position: 0.0, 2.0, 0.0 @@ -50,4 +51,3 @@ Current position: 0.0, 19.0, 0.0 Current position: 0.0, 20.0, 0.0 ... sent 20 BUILD SUCCESSFUL (total time: 21 seconds) - diff --git a/examples/DisDemo/src/disdemo/DisDemo.java b/examples/DisDemo/src/disdemo/DisDemo.java index 07bf1bbfb5..52ca24b82a 100644 --- a/examples/DisDemo/src/disdemo/DisDemo.java +++ b/examples/DisDemo/src/disdemo/DisDemo.java @@ -31,6 +31,7 @@ public class DisDemo { int NUMBER_OF_SENDS = 20; int PORT = 3000; + int INTERVAL_MSEC = 1000; // 1 second // Create a new coordinate system at the give latitude, longitude, and altitude RangeCoordinates rangeCoordinates = new RangeCoordinates(31.435, 45.223, 17.0); @@ -78,7 +79,10 @@ public class DisDemo { DatagramPacket packet; // Do some movement for a while - System.out.println ("Sending " + NUMBER_OF_SENDS + " ESPDU packets on broadcast address=" + allBcasts + " port " + PORT); + System.out.println ("Sending " + NUMBER_OF_SENDS + " ESPDU packets at " + + INTERVAL_MSEC + " msec (" + INTERVAL_MSEC/1000.0 + + " second) intervals on"); + System.out.println (" broadcast address=" + allBcasts + " port " + PORT); for(int index = 1; index <= NUMBER_OF_SENDS; index++) { mover.step(); @@ -102,7 +106,7 @@ public class DisDemo { socket.send(packet); } - Thread.sleep(1000); + Thread.sleep(INTERVAL_MSEC); System.out.println("... sent " + index); } } -- GitLab