Require_once ("Benchmark / Timer.php");
$ String = "";
$ TIMER = New Benchmark_timer ();
$ TIMER-> Start ();
For ($ I = 1; $ i <= 10000; $ i )
{
$ String. = $ I;
}
$ TIMER-> SetMarker ('Mark1');
$ String = "";
For ($ I = 1; $ i <= 1000; $ i )
{
$ String. = $ I;
}
$ TIMER-> Stop ();
$ TIMER-> Display ();
?>
This way you can clearly see the time running each block, then find the problem. Not only that, the other two classes in Benchmark can be clearly known and the number of times of the CALL of the function or the class is running. as follows:
Code
Require_once ("Benchmark / Iterate.php"); $ BENCHMARK = New Benchmark_Iterage; Class Myclass {Function Foo ($ String) {for ($ I = 1; $ I <= 10000; $ i ) {}}}} Myobj = new myclass (); $ Benchmark-> Run (10, 'myobj-> foo', 'test'); $ results = $ benchmark-> get (); print_r ($ results);?>>>