ectionSortTimer.java source code
import java.util.Scanner;
/**
This program measures how long it takes to sort an
array of a user-specified size with the selection
sort algorithm.
*/
public class SearchTimer
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Enter array size: ");
int n = in.nextInt();
// Construct an appropriate array
// call your search
// Use stopwatch to time the search
StopWatch timer = new StopWatch();
timer.start();
// call the search
timer.stop();
System.out.println("Elapsed time: "
+ timer.getElapsedTime() + " milliseconds");
}
}