Script speed analyse

This is a discussion on Script speed analyse within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello to all, I have the following script. This one read pictures in a directory and show them quickly. The $...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-29-2007
otto
 
Posts: n/a
Default Script speed analyse

Hello to all,
I have the following script. This one read pictures in a directory and show them quickly.
The $files array is about 4000 rec. big. When the variable $filtre should select only 10 to 50 pictures it take to much time for the moment and I'm looking if
I can optimize this.
Question : it is possible with PHP to analyses the used time between some scripts lines?
Could be more difficult when I'm also using Javascript!

Thanks in advance for any help.
Otto



// Session variables
$files = $_SESSION['files'];
$filtre = $_GET['filtre'];

# Display speed
$peed = 250;

# Directory of pictures
$pict_path = "camera25/";

echo "
<script type='text/javascript'>
Animation=new Array();
bild=new Array();
var i=0;
";

# Selection (filtre)
$by = 1;
while ($by < count($files))
{
if (substr($files[$by],10,6) == $filtre)
{
echo "bild[$by]='$pict_path$files[$by]';\n";
}
$by++;
}

echo "
for(r=0;r < $by; r++)
{
Animation[r]=new Image(); Animation[r].src=bild[r];
}

function anzeigen()
{
if(i < $by){
document.images.dummy.src=Animation[i].src;
i++;
}
else
{
i=0;
}
setTimeout('anzeigen()',$peed);
}
</script>

<body onLoad='anzeigen();'>
<div align=left><img name='dummy'></div>";
?>
Reply With Quote
  #2 (permalink)  
Old 11-30-2007
Olaf Schinkel
 
Posts: n/a
Default Re: Script speed analyse

Hello!

You should see, that a PHP Script is running on the Server, Javascript
on the Client.
So, Javascript has nothing to do with the PHP Script time.

How long is a Script running?

<?PHP
$start = time();

// Your Script

$end = time();
$scripttime = $end - $start;
// taaataaaaa
?>

Maybe you can use additionally ob_start() .....etc


Olaf
Reply With Quote
  #3 (permalink)  
Old 11-30-2007
otto
 
Posts: n/a
Default Re: Script speed analyse

On Fri, 30 Nov 2007 02:19:58 +0100, Olaf Schinkel <trash@schinkel.tv> wrote:

Hello Olaf,

I don't have much experience with PHP!
Many thanks for your help
Otto

>Hello!
>
>You should see, that a PHP Script is running on the Server, Javascript
>on the Client.
>So, Javascript has nothing to do with the PHP Script time.
>
>How long is a Script running?
>
><?PHP
>$start = time();
>
>// Your Script
>
>$end = time();
>$scripttime = $end - $start;
>// taaataaaaa
>?>
>
>Maybe you can use additionally ob_start() .....etc
>
>
>Olaf

Reply With Quote
  #4 (permalink)  
Old 12-02-2007
Onideus Mad Hatter
 
Posts: n/a
Default Re: Script speed analyse

On Fri, 30 Nov 2007 08:18:03 +0100, otto <ohaldi@freesurf.ch> wrote:

>On Fri, 30 Nov 2007 02:19:58 +0100, Olaf Schinkel <trash@schinkel.tv> wrote:
>
>Hello Olaf,
>
>I don't have much experience with PHP!


Nor with Usenet for that matter, you top poasting dipshit.

--

Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog


Hatter Quotes
-------------
"You're only one of the best if you're striving to become one of the
best."

"I didn't make reality, Sunshine, I just verbally bitch slapped you
with it."

"I'm not a professional, I'm an artist."

"Your Usenet blinders are my best friend."

"Usenet Filters - Learn to shut yourself the fuck up!"

"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."

"There are clingy things in the grass...burrs 'n such...mmmm..."

"The more I learn the more I'm killing my idols."

"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"

"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."

"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."

"Reality is directly proportionate to how creative you are."

"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."

"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."

"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."

"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."

"Those who record history are those who control history."

"I am the living embodiment of hell itself in all its tormentive rage,
endless suffering, unfathomable pain and unending horror...but you
don't get sent to me...I come for you."

"Ideally in a fight I'd want a BGM-109A with a W80 250 kiloton
tactical thermonuclear fusion based war head."

"Tell me, would you describe yourself more as a process or a
function?"

"Apparently this group has got the market cornered on stupid.
Intelligence is down 137 points across the board and the forecast
indicates an increase in Webtv users."

"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:03 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0