Jader Dias
0
Q:

php time script

//place this before any script you want to calculate time
$time_start = microtime(true); 

//sample script
for($i=0; $i<1000; $i++){
 //do anything
}

$time_end = microtime(true);
$execution_time = ($time_end - $time_start);
echo '<b>Total Execution Time:</b> '.$execution_time.' Seconds';
3
<?php
$startTime = microtime(true);

/*stuff is going on*/

echo "Elapsed time is: ". (microtime(true) - $startTime) ." seconds";
1
<?php 
/* Unix Timestamp */
$timestamp = time();
echo $timestamp . "<br>";
echo date("d/m/Y", $timestamp);
?>
1
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
2

New to Communities?

Join the community