diff src/main/java/alice/test/codesegment/api/FlipTest.java @ 345:8f71c3e6f11d

Change directory structure Maven standard
author sugi
date Wed, 16 Apr 2014 18:26:07 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/alice/test/codesegment/api/FlipTest.java	Wed Apr 16 18:26:07 2014 +0900
@@ -0,0 +1,38 @@
+package alice.test.codesegment.api;
+
+import alice.codesegment.CodeSegment;
+import alice.datasegment.CommandType;
+import alice.datasegment.Receiver;
+
+public class FlipTest extends CodeSegment{
+	
+	private Receiver arg1 = ids.create(CommandType.PEEK);
+	public static long t = 0;
+	public static boolean flag = false;
+	public static int count = 10000;
+	public FlipTest(String key){
+		arg1.setKey(key);
+	}
+	
+	public FlipTest(String key, int index){
+		arg1.setKey(key, index);
+	}
+
+	@Override
+	public void run() {
+		if(flag){
+			System.out.println(System.currentTimeMillis() - t +" ms");
+			System.exit(0);
+		}
+		t = System.currentTimeMillis();
+		for (int i=0;i<count;i++)
+			ods.flip(arg1);
+			//ods.put(arg1.key ,arg1.getObj());
+		flag=true;
+
+		new FlipTest(arg1.key,count);
+				
+	}
+
+
+}