
tbh, i dont care about which is faster, theyre both pretty fast it makes them near negligible
but anyway:
You are kinda contradicting yourself here..We're not doing it 1000 times, or 100 times.. we're doing it one time. And when it comes down to it, my way (one time) if faster then your way.
http://projects.dopaul.com/test.php?...ce&hotel=co.uk
When it comes to doing it once, my way is faster.PHP Code:<?php
$hotel = $_GET["hotel"]; // abbrev.. co.uk, com, ca.
$data = @file_get_contents("http://www.habbo.{$hotel}");
if(!$data) {
exit("Could not grab data.");
}
require_once 'Benchmark/Timer.php';
//create an instance of the Benchmark_Timer class
$timer = new Benchmark_Timer();
//Set "Start" marker
$timer->start();
$pattern = '<span class="stats-fig">';
$pattern .= '(\\d+)';
$pattern .= '(<\\/span>)';
preg_match_all ("/{$pattern}/is", $data, $matches);
$timer->setMarker('caleb');
preg_match('#<span class="stats-fig">(\d+)</span>#i', $data, $matches);
$timer->setMarker('iszak');
//Set "Stop" marker
$timer->stop();
//Returns formatted informations
$timer->display(true);
?>
<br />
<br />
<strong>caleb benchmark code:</strong>
<br />
<code>
$pattern = '<span class="stats-fig">';<br />
$pattern .= '(\\d+)';<br />
$pattern .= '(<\\/span>)';<br />
<br />
preg_match_all ("/{$pattern}/is", $data, $matches);
</code>
<br />
<br />
<strong>iszak benchmark code:</strong><br />
<code>
preg_match('#<span class="stats-fig">(\d+)</span>#i', $data, $matches);
</code>
Refresh more then once to get a accurate average of times.
That's totally different then doing them in a loop, and recording the time.
Anyways, I'm done here for now.
no but you were saying that youre not going to do it more than once, (which meant that iszak's was faster, but you claimed yours was), but then you said refresh it to get a good average (which makes yours better, when you said iszaks was better)
oh drama, who gives a **** - they both work and are both reasonably fast.
Hi, names James. I am a web developer.
Want to hide these adverts? Register an account for free!