Profiling the Selection Sort Algorithm
- We want to measure the time the algorithm takes to execute
- Exclude the time the program takes to load
- Exclude output time
- Create a StopWatch class to measure execution time of
an algorithm
- It can start, stop and give elapsed time
- Use System.currentTimeMillis method
- Create a StopWatch object
- Start the stopwatch just before the sort
- Stop the stopwatch just after the sort
- Read the elapsed time