I think it has to do with $total_time being set to a string before the line in question tries to add a float value to it.
In any case, $total_time is never used. You should be able to safely comment out these two lines and get rid of the problem:
// $total_time = '';
// $total_time += ($time_stop - $time_start);