The Controls Across the Top
Randomize
Left click on this button to populate the array with integers, duplicates allowed. Right click to randomize with all different numbers - no duplicates. It may take a little while to randomize large arrays. The backcolor of the timer will turn to brown when done.
Ascend
This button toggles ascend with descend to indicate the direction in which the array will be sorted. After an array is sorted, change direction and see how long it takes to sort when the array is completely ordered in the opposite direction. You might also check to see how long the various methods take to sort an array that is already sorted (in the same direction).
Timings
Click this to perform the timings. The time for each method included will be displayed in milliseconds (1000 = 1 second) as the individual sorts complete. Note that each method will be sorting the exact same array (element values in the same order) to give true comparability.
The timing uses an API call and includes no DoEvents while sorting for the most accurate timing. That means, however, that your computer will seem to lock up while sorting. While running from the VB editor, you back stop at any time by pressing [Ctrl][Break].
Elements
Enter a different number in the textbox to change the number of elements to be sorted (minimum 100, maximum 32766). After changing the value (and pressing enter or tabbing) the backcolor will change to orange while the new size array is being populated and randomized. Wait for it to turn brown again.
For elements exceeding 10,000, you may want to include just the fastest sorting methods (Count, Heap, Quick, and Shell). Refer to the my timings chart below.
The Command Buttons down the Side
Include
Include buttons toggle with exclude allowing you to time only certain sorting methods. Right click to quickly select only one method.
Confirm
Sorted arrays are checked after each sort to ascertain that they are truly ordered (!order! if failed). Further a checksum is verified to be sure all the numbers are there (!total! if failed). If both checks are passed then this column will show the word success.
The array is ordered if the last timed sort succeeds. This allows you to toggle ascend and sort the array with elements in completely reversed order.
My timings on these methods from the VB editor on my AMD K6-450 computer