/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.test.microbench;

import javax.naming.InitialContext;

/**
 * Comment
 *
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 * @version $Revision: 1.1.2.4 $
 */
public class Benchmark implements BenchmarkMBean
{
   public long benchLocalStateless21(int iterations) throws Exception
   {
      StatelessHomeLocal home = (StatelessHomeLocal) new InitialContext().lookup("StatelessBean21Local");
      StatelessLocal21 local = home.create();
      long start = System.currentTimeMillis();
      for (int i = 0; i < iterations; i++)
      {
         local.test(i);
      }
      return System.currentTimeMillis() - start;
   }

   public long benchLocalStateless30(int iterations) throws Exception
   {
      StatelessLocal local = (StatelessLocal) new InitialContext().lookup(StatelessLocal.class.getName());
      long start = System.currentTimeMillis();
      for (int i = 0; i < iterations; i++)
      {
         local.test(i);
      }
      return System.currentTimeMillis() - start;
   }
}
