publicstaticlong test_virtual(HashMap map) {
Integer intobj = new Integer(0);
String s = "asdf"; long start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) {
map.put(intobj, s);
} long end = System.currentTimeMillis(); return (end - start);
}
publicstaticlong test_interface(Map map) {
Integer intobj = new Integer(0);
String s = "asdf"; long start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) {
map.put(intobj, s);
} long end = System.currentTimeMillis(); return (end - start);
}
publicstaticvoid main(String[] args) {
HashMap hashmap = new HashMap(); long elapsed = test_virtual(hashmap);
System.out.println("test_virtual done");
hashmap.clear();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.