you where using $timeDiff as a value which if you had printed you would see was something like 'Benchmark=ARRAY(0xbc53f0)' this was then being used to do some calcs

this works to 2 dp on my machine

Code:
use Benchmark;
my $startBenchmark = new Benchmark;

# wasting time 
for ($i=0;$i<1000000;$i++){}

 
my $endBenchmark = new Benchmark; 
my $timeDiff = timediff($endBenchmark,$startBenchmark); 
 
$_=timestr($timeDiff);
/([\d\.]+) CPU/;
$f=$1;
print "<font size=\"-2\">Searched for: $f seconds</font>\n\n";