Mercurial > hg > Database > Alice
comparison 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 | aefbe41fcf12 |
comparison
equal
deleted
inserted
replaced
344:9f97ec18f8c5 | 345:8f71c3e6f11d |
---|---|
1 package alice.test.codesegment.api; | |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.Receiver; | |
6 | |
7 public class FlipTest extends CodeSegment{ | |
8 | |
9 private Receiver arg1 = ids.create(CommandType.PEEK); | |
10 public static long t = 0; | |
11 public static boolean flag = false; | |
12 public static int count = 10000; | |
13 public FlipTest(String key){ | |
14 arg1.setKey(key); | |
15 } | |
16 | |
17 public FlipTest(String key, int index){ | |
18 arg1.setKey(key, index); | |
19 } | |
20 | |
21 @Override | |
22 public void run() { | |
23 if(flag){ | |
24 System.out.println(System.currentTimeMillis() - t +" ms"); | |
25 System.exit(0); | |
26 } | |
27 t = System.currentTimeMillis(); | |
28 for (int i=0;i<count;i++) | |
29 ods.flip(arg1); | |
30 //ods.put(arg1.key ,arg1.getObj()); | |
31 flag=true; | |
32 | |
33 new FlipTest(arg1.key,count); | |
34 | |
35 } | |
36 | |
37 | |
38 } |