 		 * This function will sort an Array (or Vector) immediately.
 		 * @param array An Array (or Vector) to sort in place.
 		 * @param compareFunction The function used to compare items in the array.
-		 */		
+		 */
 		public static function sortImmediately(array:*, compareFunction:Function = null):void
 		{
 			if (!_immediateSorter)

			Array.sort 50000 numbers; 37.285 seconds; 10238787 comparisons
			Merge Sort 50000 numbers; 2.603 seconds; 585089 comparisons
		*/
		public static function test(useDefaultSort:Boolean):void
		{
			for each (var n:uint in [0,1,2,3,4,5,50,3000,6000,12000,25000,50000])
			{
				var array:Array = [];
				for (var i:int = 0; i < n; i++)
					array.push(Math.random() < .5 ? NaN : uint(Math.random()*100));
				var array2:Array = array.concat();
				
				var start:int = getTimer();
				_debugCompareCount = 0;
				if (useDefaultSort)
					array.sort();
				else
					array.sort(_debugCompare);
				trace('Array.sort', n, 'numbers;', (getTimer() - start) / 1000, 'seconds;',_debugCompareCount,'comparisons');
				
				start = getTimer();
				_debugCompareCount = 0;
				if (useDefaultSort)
					sortImmediately(array2);
				else
					sortImmediately(array2, _debugCompare);
				//trace('Merge Sort', n, 'numbers;', _immediateSorter.elapsed / 1000, 'seconds;',_debugCompareCount,'comparisons');
				trace('Merge Sort', n, 'numbers;', (getTimer() - start) / 1000, 'seconds;',_debugCompareCount,'comparisons');
				
				if (array2.length == 1 && ObjectUtil.compare(array[0],array2[0]) != 0)
					throw new Error("sort failed on array length 1");
				
				verifyNumbersSorted(array2);

		 ** Testing **
		 *************/
		
		/*
			Built-in sort is slower when using a compare function because it uses more comparisons.
			Array.sort 50 numbers; 0.002 seconds; 487 comparisons
			Merge Sort 50 numbers; 0.001 seconds; 208 comparisons
			Array.sort 3000 numbers; 0.304 seconds; 87367 comparisons
