} function total() { global $total; $pad = str_repeat("-", 24); echo $pad . "\n"; $num = number_format($total, 3); $pad = str_repeat(" ", 24 - strlen("Total") - strlen($num)); echo "Total" . $pad . $num . "\n"; } $t0 = $t = start_test(); simple(); $t = end_test($t, "simple"); simplecall(); $t = end_test($t, "simplecall"); simpleucall(); $t = end_test($t, "simpleucall"); simpleudcall(); $t = end_test($t, "simpleudcall"); mandel(); $t = end_test($t, "mandel"); mandel2(); $t = end_test($t, "mandel2"); ackermann(7); $t = end_test($t, "ackermann(7)"); ary(50000); $t = end_test($t, "ary(50000)"); ary2(50000); $t = end_test($t, "ary2(50000)"); ary3(2000); $t = end_test($t, "ary3(2000)");
} function total() { global $total; $pad = str_repeat("-", 24); echo $pad . "\n"; $num = number_format($total, 3); $pad = str_repeat(" ", 24 - strlen("Total") - strlen($num)); echo "Total" . $pad . $num . "\n"; } const N = 5000000; $t0 = $t = start_test(); empty_loop(N); $t = end_test($t, 'empty_loop'); $overhead = $last_time; simpleucall(N); $t = end_test($t, 'func()', $overhead); simpleudcall(N); $t = end_test($t, 'undef_func()', $overhead); simpleicall(N); $t = end_test($t, 'int_func()', $overhead); Foo::read_static(N); $t = end_test($t, '$x = self::$x', $overhead); Foo::write_static(N); $t = end_test($t, 'self::$x = 0', $overhead); Foo::isset_static(N); $t = end_test($t, 'isset(self::$x)', $overhead); Foo::empty_static(N); $t = end_test($t, 'empty(self::$x)', $overhead); read_static(N); $t = end_test($t, '$x = Foo::$x', $overhead);