Skip to content
Snippets Groups Projects
Commit 559752dc authored by brutzman's avatar brutzman
Browse files

improved timing diagnostic messages

parent 7b585ddc
No related branches found
No related tags found
No related merge requests found
...@@ -24,10 +24,10 @@ public class AllPduSender ...@@ -24,10 +24,10 @@ public class AllPduSender
public static final int DEFAULT_MULTICAST_PORT = 3000; public static final int DEFAULT_MULTICAST_PORT = 3000;
/** Duration in milliseconds, set to 0 to avoid pausing between PDU sends */ /** Duration in milliseconds, set to 0 to avoid pausing between PDU sends */
private long THREAD_SLEEP_INTERVAL = 0; private long THREAD_SLEEP_INTERVAL = 2000;
/** Number of complete loops to perform */ /** Number of complete loops to perform */
private int SEND_LOOPS_TO_PERFORM = 1; private int SEND_LOOPS_TO_PERFORM = 10;
private int port; private int port;
private InetAddress multicastAddress; private InetAddress multicastAddress;
...@@ -48,11 +48,23 @@ public class AllPduSender ...@@ -48,11 +48,23 @@ public class AllPduSender
} }
} }
@SuppressWarnings("SleepWhileInLoop")
public int run() public int run()
{ {
System.out.println("OpenDis7Examples.AllPduSender started..."); System.out.println("OpenDis7Examples.AllPduSender started...");
if (SEND_LOOPS_TO_PERFORM != 1) if (SEND_LOOPS_TO_PERFORM != 1)
System.out.println("... running for " + SEND_LOOPS_TO_PERFORM + " loops"); {
float waitIntervalSeconds = ((float)THREAD_SLEEP_INTERVAL / 1000);
float loopIntervalSeconds = ((float)THREAD_SLEEP_INTERVAL / 1000) * 72; // 72 PDUs
float totalDurationSeconds = loopIntervalSeconds * SEND_LOOPS_TO_PERFORM ;
System.out.println("... THREAD_SLEEP_INTERVAL = " + THREAD_SLEEP_INTERVAL + " milliseconds = " + waitIntervalSeconds + " seconds");
System.out.print ("... running for ");
if (SEND_LOOPS_TO_PERFORM > 1)
System.out.print (SEND_LOOPS_TO_PERFORM + " loops, ");
if (THREAD_SLEEP_INTERVAL > 0)
System.out.println("expected loop interval = " + loopIntervalSeconds + " seconds, total duration = " +
totalDurationSeconds + " seconds = " + (totalDurationSeconds/60.0) + " minutes");
}
System.out.println("Generate list of all PDU types and note issues, if any..."); System.out.println("Generate list of all PDU types and note issues, if any...");
List<Pdu> generatedPdusList = new ArrayList<>(); List<Pdu> generatedPdusList = new ArrayList<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment