예제 #1
0
    public static string[] Main(string[] args)
    {
        // figure out the overhead of processing the file
        // without counting words, and then use it as a
        // baseline for the other versions
        WordCountNoStorage wcns     = new WordCountNoStorage(args);
        TimeSpan           overhead = wcns.DoCount();

        Console.WriteLine("Overhead = {0}", overhead);
        wcns     = new WordCountNoStorage(args);
        overhead = wcns.DoCount();
        Console.WriteLine("Overhead = {0}", overhead);

        WordCountBoxedInt wcbi = new WordCountBoxedInt(args);

        wcbi.DoCount(overhead);
        wcbi = new WordCountBoxedInt(args);
        wcbi.DoCount(overhead);

        WordCountInterface wci = new WordCountInterface(args);

        wci.DoCount(overhead);
        wci = new WordCountInterface(args);
        wci.DoCount(overhead);

        WordCountIntHolder wcih = new WordCountIntHolder(args);

        wcih.DoCount(overhead);
        wcih = new WordCountIntHolder(args);
        wcih.DoCount(overhead);
    }
예제 #2
0
    public static string[] Main(string[] args)
    {
        // figure out the overhead of processing the file
            // without counting words, and then use it as a
            // baseline for the other versions
        WordCountNoStorage wcns = new WordCountNoStorage(args);
        TimeSpan overhead = wcns.DoCount();
        Console.WriteLine("Overhead = {0}", overhead);
        wcns = new WordCountNoStorage(args);
        overhead = wcns.DoCount();
        Console.WriteLine("Overhead = {0}", overhead);

        WordCountBoxedInt wcbi = new WordCountBoxedInt(args);
        wcbi.DoCount(overhead);
        wcbi = new WordCountBoxedInt(args);
        wcbi.DoCount(overhead);

        WordCountInterface wci = new WordCountInterface(args);
        wci.DoCount(overhead);
        wci = new WordCountInterface(args);
        wci.DoCount(overhead);

        WordCountIntHolder wcih = new WordCountIntHolder(args);
        wcih.DoCount(overhead);
        wcih = new WordCountIntHolder(args);
        wcih.DoCount(overhead);
    }