FileDocCategorySizeDatePackage
ListPerformance.javaAPI DocExample4255Mon Apr 06 18:10:26 BST 1998c08.newcollections

ListPerformance

public class ListPerformance extends Object

Fields Summary
private static final int
REPS
private static Tester[]
tests
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    test(new ArrayList());
    test(new LinkedList());
  
public static voidtest(java.util.List a)

       
    // A trick to print out the class name:
    System.out.println("Testing " + 
      a.getClass().getName());
    for(int i = 0; i < tests.length; i++) {
      Collection1.fill(a, tests[i].size);
      System.out.print(tests[i].name);
      long t1 = System.currentTimeMillis();
      tests[i].test(a);
      long t2 = System.currentTimeMillis();
      System.out.println(": " + (t2 - t1));
    }