Hi
Thanks for the link but it still isn't working how i want. Here is my code.
<?php
if (isset($_FILES['avatar']['tmp_name'])) {
$time_start = microtime(true);
$uploadfile = $_FILES['avatar']['tmp_name'];
$path = "testing/test1";
if (move_uploaded_file($uploadfile, $path)) {
echo 'File uploaded!<br />';
}
$time_end = microtime(true);
$time = $time_end - $time_start;
echo 'Script took '.$time.' seconds to exicute';
}
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="avatar" />
<input type="submit" value="Upload" />
</form>
The problem is that it records how long the script took to execute which was 0.00161695480347 seconds.
I want it to tell me how long it took to transfer the file from the user's computer to the server e.g. 35 seconds.
I think php first uploads the file to the server before processing the if (isset($_FILES['avatar']['tmp_name'])) and so i cannot find out how long it took, only how long it took for the rest of the code including moving the temporary file to the new location.