// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class CHM {
    private static final int N = 100;
    private static final int REP = 100000000;
    public static void main(String[] args) {
        Map<String, String> m = new ConcurrentHashMap<String, String>();
        for(int i = 0; i < N; i++) {
            m.put(Integer.toString(i), "Test #" + Integer.toString(i));
        }
        long t1 = System.currentTimeMillis();
        for(int i = 0; i < REP; i++) {
            if(m.get(Integer.toString(i % N)) == null) {
                throw new RuntimeException("Houston we have a problem");
            }
        }
        long t2 = System.currentTimeMillis();
        System.out.println(REP*1000L/(t2-t1));
        System.out.println(1000000000.0 / (REP*1000L/(t2-t1)));
    }
}
