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 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24
  1. #11

    Default

    There's nothing wrong with that way, I was just proving Caleb wrong that's all.

  2. #12
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    oh right!!
    Well, he sent me a pm (the OP) the other day asking for the code i posted which was an updated version of the one that was posted in the tutorials section.

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

    Latest Awards:

    Default

    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.

  4. #14
    Join Date
    May 2008
    Posts
    1,160
    Tokens
    11

    Latest Awards:

    Default

    I'm confused as to how yours is faster?







    Previously a Habbo fanatic, web designer/developer, fansite owner, & trusted member of the community.

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

    Latest Awards:

    Default

    Refresh more then once.

  6. #16
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default


  7. #17
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I'll look at it later, I'm not feeling good/good enough mood to care at the moment.

  8. #18
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    I was showing yours was faster ^_^

  9. #19

    Default

    Your testing has too many variables Caleb and thus has a less accurate result, check out mine (revised because you said "When it comes to doing it once, my way is faster.") still is faster

    0.00012993812561 - Caleb
    0.0000379085540771 - Mine

    Edit: Same links by the way, for those who want to check it out.
    Last edited by Iszak; 22-03-2009 at 08:42 PM.

  10. #20
    Join Date
    May 2008
    Posts
    1,160
    Tokens
    11

    Latest Awards:

    Default

    Lol. I refresh and yours it faster.

    Then I refresh again and his is faster.

    And it just goes back and forth again and again. :rolleyes:
    Previously a Habbo fanatic, web designer/developer, fansite owner, & trusted member of the community.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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