WordPress.org

Make WordPress Core

Changeset 488 in tests


Ignore:
Timestamp:
12/16/11 13:48:51 (2 years ago)
Author:
duck_
Message:

test_action_performance isn't a test, and it messes up the output :'(

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_actions.php

    r407 r488  
    199199    } 
    200200 
    201     function test_action_performance() { 
    202         $a = new MockAction(); 
    203         $tags = array(rand_str(), rand_str(), rand_str(), rand_str(), rand_str()); 
    204  
    205         // two actions per tag 
    206         foreach ($tags as $tag) { 
    207             add_action($tag, array(&$a, 'action')); 
    208             add_action($tag, array(&$a, 'action2')); 
    209         } 
    210  
    211         $delta = 0.0; 
    212         $count = 0; 
    213         for ($i=0; $i<100; $i++) { 
    214             foreach ($tags as $tag) { 
    215                 $start = microtime(true); 
    216                 do_action($tag); 
    217                 $delta += (microtime(true) - $start); 
    218                 ++$count; 
    219             } 
    220         } 
    221  
    222         printf("Action Time: %0.8f (%0.8f each)\n", $delta, $delta/$count); 
    223     } 
    224  
    225201    function test_action_ref_array() { 
    226202        $obj = new stdClass(); 
Note: See TracChangeset for help on using the changeset viewer.