comparison src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/xml/UntilTreeMapPutTime.java @ 17:917ecf2c7350

function Measurement
author one
date Wed, 24 Dec 2014 15:48:32 +0900
parents 047bbe894005
children 190890be73e4
comparison
equal deleted inserted replaced
16:eed6235830c9 17:917ecf2c7350
4 import java.io.File; 4 import java.io.File;
5 import java.io.FileWriter; 5 import java.io.FileWriter;
6 import java.io.IOException; 6 import java.io.IOException;
7 import java.io.PrintWriter; 7 import java.io.PrintWriter;
8 import java.util.TreeMap; 8 import java.util.TreeMap;
9
10 9
11 public class UntilTreeMapPutTime { 10 public class UntilTreeMapPutTime {
12 11
13 public static void main(String args[]) throws IOException { 12 public static void main(String args[]) throws IOException {
14 File file = new File("./time/until"); 13 File file = new File("./time/until");
16 TreeMap<Integer, Integer> map = new TreeMap<Integer,Integer>(); 15 TreeMap<Integer, Integer> map = new TreeMap<Integer,Integer>();
17 for (int count = 0; count <= 48800; count++) { 16 for (int count = 0; count <= 48800; count++) {
18 long t1 = System.currentTimeMillis(); 17 long t1 = System.currentTimeMillis();
19 map.put(count, count); 18 map.put(count, count);
20 long t2 = System.currentTimeMillis(); 19 long t2 = System.currentTimeMillis();
20 int aaa = map.get(count);
21 long t3 = System.currentTimeMillis();
22 if ((count % 100) == 0) {
21 System.out.println("put time " + count + " " + (t2 - t1)); 23 System.out.println("put time " + count + " " + (t2 - t1));
24 System.out.println("get time " + count + " " + (t3 - t2));
25
22 pw.println(count + " " + (t2 - t1)); 26 pw.println(count + " " + (t2 - t1));
27 }
23 } 28 }
24 pw.close(); 29 pw.close();
25 } 30 }
26 } 31 }