$start = [times()]; ...somecode... $end = [times()]; $time_diff =($start->[0] + $start->[1]) - ($end->[0] + $end->[1]);