import type.lib.Investment;
import type.lib.Stock;
import java.io.PrintStream;

/**
 * Times operations of the Portfolio class.
 * 
 * @author Franck van Breugel
 */
public class PortfolioClient
{
    /**
     * Times operations of the Portfolio class.
     * 
     * @param args[0] Size of the portfolio.
     */
    public static void main(String[] args)
    {
	PrintStream output = System.out;

	Investment investment = new Investment(new Stock("IBM"), 1, 100.00);
	final int SIZE = Integer.parseInt(args[0]);

	long start = System.currentTimeMillis();

	Portfolio portfolio = new Portfolio();
	for (int i = 0; i < SIZE; i++)
	{
	    portfolio.add(investment);
	}
	for (int i = 0; i < SIZE; i++)
	{
	    portfolio.get(i);
	}
	long stop = System.currentTimeMillis();

	output.println(stop - start);
    }
}
