Location: PHPKode > scripts > Enhanced QuickSort > enhanced-quicksort/qstest.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

<?php
include('includes/classes/quicksort.php');

srand(time());
$random = array();

//best if used for 10000 items or less.
for($i = 0; $i < 5000; $i++){
	$random[] = (rand()%9);
}

$qs = new QuickSort($random);
unset($random);

$time1 = time();
$qs->sortArray();
$time2 = time();
$sorted = $qs->getSortedArray();

echo "Maximum Ex Time: ".($time2-$time1)."ms<br><br>";

//foreach($sorted as $value){
//	echo $value." ";
//}
?>
</body>
</html>
Return current item: Enhanced QuickSort