You need a start and end time() (or microtime() if you want higher fidelity). Take the difference to get the number of seconds. Also, if you want to use a switch, it might be something like
<?php
$startTime = time();
/*
Lots of amazing code that does all sorts of cool things
*/
$totalTime = time() - $startTime;
switch(true) {
case($totalTime <= 1):
echo "Sweet!";
break;
case($totalTime < 10): // otherwise the > 10 would never trigger
echo "Not so hot."
break;
default:
echo "That sucked!";
}