198
|
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;
|
233
|
12 public static int count = 10000;
|
198
|
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() {
|
233
|
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;
|
205
|
32
|
233
|
33 new FlipTest(arg1.key,count);
|
|
34
|
198
|
35 }
|
|
36
|
205
|
37
|
198
|
38 }
|