Jump to content

Calculating Time Takes Script to Execute


e1seix

Recommended Posts

Hi again,

 

Busy night. Have wondered about how long it takes one of my lengthy scripts to execute so I can calculate my cron jobs and not have them overlapping.

 

I have found this

 

$time = microtime();
$time = explode(" ", $time);
$time = $time+ $time[0];
$time1 = $time;

CODE THAT NEEDS TIMING

$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$time2 = $time;

$totaltime = ($time2 - $time1);
echo '<BR>Parsing time: ' .$totaltime. ' seconds.'; 

 

However, I keep getting "Fatal error: Unsupported operand types in /home/e1seix/public_html/controlPanel/update2.php on line 5". Is there a solution or an alternative? Many thanks.

 

PS. Would really appreciate some help on my last thread. It's going further and further down the page and I don't want to bump it. lol

 

Honestly, thank you everyone!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.