14
|
1 package jp.ac.u_ryukyu.ie.cr.tatsuki.xml;
|
|
2
|
|
3 import java.io.BufferedWriter;
|
|
4 import java.io.File;
|
|
5 import java.io.FileWriter;
|
|
6 import java.io.IOException;
|
|
7 import java.io.PrintWriter;
|
|
8 import java.util.TreeMap;
|
|
9
|
|
10 public class UntilTreeMapPutTime {
|
|
11
|
|
12 public static void main(String args[]) throws IOException {
|
|
13 File file = new File("./time/until");
|
|
14 PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
|
|
15 TreeMap<Integer, Integer> map = new TreeMap<Integer,Integer>();
|
|
16 for (int count = 0; count <= 48800; count++) {
|
|
17 long t1 = System.currentTimeMillis();
|
|
18 map.put(count, count);
|
|
19 long t2 = System.currentTimeMillis();
|
17
|
20 int aaa = map.get(count);
|
|
21 long t3 = System.currentTimeMillis();
|
|
22 if ((count % 100) == 0) {
|
14
|
23 System.out.println("put time " + count + " " + (t2 - t1));
|
17
|
24 System.out.println("get time " + count + " " + (t3 - t2));
|
|
25
|
14
|
26 pw.println(count + " " + (t2 - t1));
|
17
|
27 }
|
14
|
28 }
|
|
29 pw.close();
|
|
30 }
|
|
31 }
|