# HG changeset patch # User one # Date 1328709852 -32400 # Node ID 49e7f02f006338c297f65c88592a6b65ced4ef5c # Parent 2a64c13e743aa14e9fa6eca661d4ad4f78e96ee7 change timer date from nanoTime diff -r 2a64c13e743a -r 49e7f02f0063 src/fdl/test/debug/RoutingCallback.java --- a/src/fdl/test/debug/RoutingCallback.java Wed Feb 08 18:02:40 2012 +0900 +++ b/src/fdl/test/debug/RoutingCallback.java Wed Feb 08 23:04:12 2012 +0900 @@ -59,8 +59,9 @@ // int num = Integer.parseInt(new String(reply.array())); tp.startTree(ByteBuffer.wrap((""+tp.treeCounter).getBytes())); } else { - tp.endTime = new Date(); - Double resultTime = new Double(((tp.endTime.getTime() - tp.startTime.getTime()) / (double)tp.treeLoopNum)); + tp.endTime = System.nanoTime(); + Long resultTime = new Long((tp.endTime - tp.startTime)/tp.treeLoopNum); + //Double resultTime = new Double(((tp.endTime.getTime() - tp.startTime.getTime()) / (double)tp.treeLoopNum)); ByteBuffer data = ByteBuffer.wrap(resultTime.toString().getBytes()); np.manager.out(TupleId.START.id, data); Debug.print("Finish Tree"); @@ -118,8 +119,9 @@ Debug.print("" + dp.relayCounter + " relay"); if (dp.relayCounter >= dp.relayNum) { // 実験終了 - tp.endTime = new Date(); - Double resultTime = new Double(((tp.endTime.getTime() - tp.startTime.getTime()) / (double)dp.relayNum)); + tp.endTime = System.nanoTime(); + //Double resultTime = new Double(((tp.endTime.getTime() - tp.startTime.getTime()) / (double)dp.relayNum)); + Long resultTime = new Long((tp.endTime - tp.startTime)/dp.relayNum); ByteBuffer data = ByteBuffer.wrap(resultTime.toString().getBytes()); np.manager.out(TupleId.DEBUG.id, data); np.ml.in(tid.id, this); diff -r 2a64c13e743a -r 49e7f02f0063 src/fdl/test/debug/StartCallback.java --- a/src/fdl/test/debug/StartCallback.java Wed Feb 08 18:02:40 2012 +0900 +++ b/src/fdl/test/debug/StartCallback.java Wed Feb 08 23:04:12 2012 +0900 @@ -16,7 +16,7 @@ public void callback(ByteBuffer reply) { Debug.print("Start Tree"); - tp.startTime = new Date(); + tp.startTime = System.nanoTime(); tp = new TreeProperty(np); tp.startTree(reply); np.ml.in(TupleId.BODY.id); diff -r 2a64c13e743a -r 49e7f02f0063 src/fdl/test/debug/TreeProperty.java --- a/src/fdl/test/debug/TreeProperty.java Wed Feb 08 18:02:40 2012 +0900 +++ b/src/fdl/test/debug/TreeProperty.java Wed Feb 08 23:04:12 2012 +0900 @@ -6,7 +6,7 @@ public class TreeProperty { public boolean rightFlag = true, leftFlag = true; public int treeCounter = 0, treeLoopNum = 100; - public Date startTime, endTime; + public long startTime, endTime; public NodeProperty np; public TreeProperty(NodeProperty np) {