package examples.mega.client;

/**
 * @author Copyright (c) 2002 by BEA Systems. All Rights Reserved.
 */

public class PerfClient {

  public void invoke(String url) throws Exception {

    int trials = 3;
    int count = 100;

    MegaWebService service = new MegaWebService_Impl( url );
    MegaPort port = service.getMegaPort();

    System.out.print("\n"+count+" invokes of v took: " );

    for (int i=0; i<trials; i++) {
     
      long start = System.currentTimeMillis();
 
      for (int j=0; j<count; j++) {
        port.v();
      }

      long stop = System.currentTimeMillis();
      double tps = ((double)count) / ((stop-start)/((double)1000));
 
      System.out.println( Math.round( tps ) );
    }
  }
}

