Mercurial > hg > Database > Alice
view src/alice/test/codesegment/api/FlipTest.java @ 290:4074077d118d
Refactor iterating process with for-each sentence.
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Oct 2013 03:26:38 +0900 |
parents | bc451bb72d5a |
children |
line wrap: on
line source
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); } }