Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
  1. #21
    Join Date
    Dec 2006
    Posts
    7,601
    Tokens
    95

    Latest Awards:

    Default

    tbh, i dont care about which is faster, theyre both pretty fast it makes them near negligible

    but anyway:

    Quote Originally Posted by Dentafrice View Post
    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

    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 = '&lt;span class=&quot;stats-fig&quot;&gt;';<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('#&lt;span class=&quot;stats-fig&quot;&gt;(\d+)&lt;/span&gt;#i', $data, $matches);
    </code>
    When it comes to doing it once, my way is faster.
    Quote Originally Posted by Dentafrice View Post
    Refresh more then once.
    You are kinda contradicting yourself here..

  2. #22
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by kk. View Post
    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..
    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.

  3. #23
    Join Date
    Dec 2006
    Posts
    7,601
    Tokens
    95

    Latest Awards:

    Default

    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)

  4. #24
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    oh drama, who gives a **** - they both work and are both reasonably fast.
    Hi, names James. I am a web developer.

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •