import java.security.*;
import java.math.*;

public class PerformanceTest
{
    static boolean running = true;
    static SleepThread p = new SleepThread();

    public static void main( String[] args )
    {
    	long count = 0;
	MessageDigest m = null;
	try {
		m=MessageDigest.getInstance("MD5");
	}
	catch(NoSuchAlgorithmException ae) {}

	String s="Testing...1....2...3...";

	long start = System.currentTimeMillis();
	p.start();
	while(running)
	{
		m.update(s.getBytes(),0,s.length());
	        count++;
	}

	System.out.println(count);
	System.out.println(System.currentTimeMillis() - start);
    }


	static class SleepThread extends Thread
	{
		HelloWorld cParrent;
		SleepThread() {}

		public void run()
		{
			try{
			 sleep(5000);
			}
			catch(InterruptedException ie) {}

			running=false;
		}
	}
}


