|
Posted by macca on 09/30/07 23:20
I tested your function with the code below, only I added my own test
data for the start time and end time... The code below works fine for
me, so unless you are doing something else wrong this should work.
<?php
function time_z() {
$starttime = "0.21875400 1191194097";
$endtime = "0.21875401 1191194097";
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
return $totaltime;
}
$t = time_z();
$handle = fopen("log.txt", "a+");
fwrite($handle, $t);
fclose($handle);
?>
Navigation:
[Reply to this message]
|