/*
 * XMLBench.java
 *
 * Created on February 20, 2003, 7:09 PM
 */

package XMLBench;

import java.io.*;
import java.util.*;

/**
 *
 * @author  Tienshiao Ma
 */
public class XMLBenchReadersmall {
    
    /** Creates a new instance of XMLBench */
    public XMLBenchReadersmall() {
    }
        
    private static void testReaderSetup(String s) {
        ByteArrayInputStream bin = 
            new ByteArrayInputStream(s.getBytes());
        new InputStreamReader(bin);
    }
            
    public static void runTests(String testString) {
        int iterations = 5000;
        long start;
        long stop;
        
        System.out.println("Test String is " + testString.length() + " chars.");
        
        testReaderSetup(testString);
        System.out.println("TestReaderSetup start ...");
        System.gc();
        start = System.currentTimeMillis();
        for (int i = 0; i < iterations; i++) {
            testReaderSetup(testString);
        }
        stop = System.currentTimeMillis();
        System.out.println("... TestReaderSetup end: " + (stop - start));
        
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // simple example
        runTests("<b>Hello World</b>");
        
    }

}
