Вход на сайт
Скрипт для бегунка?
124 просмотров
Перейти к просмотру всей ветки
в ответ Motomann 07.06.07 16:59
getfile.php
Код:<?
// get contents of a file into a string
$id=77;
if ($_GET['id']) $id=$_GET['id'];
$filename = "C:/www/test.it/test_vivoda_zadanoy_kartinki/$id.gif";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
header("Content-type: image/gif");
echo $contents;
?>
index.php
Код:<?
$time_start = microtime(true);
?>
<img src="getfile.php?id=26">
<?php
$time_start = microtime(true);
// Sleep for a while
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Did nothing in $time seconds\n";
?>
<?
$time_start = microtime(true);
$time_start2 = microtime(true);
?>
<Br>
<img src="user26.gif">
<?php
// Sleep for a while
$time_end2 = microtime(true);
$time2 = $time_end2 - $time_start2;
echo "Did nothing in $time2 seconds\n";
$time_start3 = microtime(true);
?>
<Br>
<img src="26.gif">
<?php
// Sleep for a while
$time_end3 = microtime(true);
$time3 = $time_end3 - $time_start3;
echo "Did nothing in $time3 seconds\n";
?>
время выполнения приблизительно одинаково...
Код:<?
// get contents of a file into a string
$id=77;
if ($_GET['id']) $id=$_GET['id'];
$filename = "C:/www/test.it/test_vivoda_zadanoy_kartinki/$id.gif";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
header("Content-type: image/gif");
echo $contents;
?>
index.php
Код:<?
$time_start = microtime(true);
?>
<img src="getfile.php?id=26">
<?php
$time_start = microtime(true);
// Sleep for a while
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Did nothing in $time seconds\n";
?>
<?
$time_start = microtime(true);
$time_start2 = microtime(true);
?>
<Br>
<img src="user26.gif">
<?php
// Sleep for a while
$time_end2 = microtime(true);
$time2 = $time_end2 - $time_start2;
echo "Did nothing in $time2 seconds\n";
$time_start3 = microtime(true);
?>
<Br>
<img src="26.gif">
<?php
// Sleep for a while
$time_end3 = microtime(true);
$time3 = $time_end3 - $time_start3;
echo "Did nothing in $time3 seconds\n";
?>
время выполнения приблизительно одинаково...
http://elektror.strana.germany.ru/ER_userbar.gifВсё что может поломаться - ломается!http://elektroreanimator.de