Mercurial > hg > FederatedLinda
changeset 119:49e7f02f0063
change timer date from nanoTime
author | one |
---|---|
date | Wed, 08 Feb 2012 23:04:12 +0900 |
parents | 2a64c13e743a |
children | d878ef49998b |
files | src/fdl/test/debug/RoutingCallback.java src/fdl/test/debug/StartCallback.java src/fdl/test/debug/TreeProperty.java |
diffstat | 3 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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);
--- 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) {