<?php

function perf_texturize() {
	wptexturize('Hey -- boo?');
	wptexturize('<a href="http://xx--xx">Hey -- boo?</a>');
	wptexturize('<pre>---</pre>');
	wptexturize('[a]a--b[code]---[/code]a--b[/a]');
	wptexturize('<pre><code></code>--</pre>');
	wptexturize('<code>---</code>');
	wptexturize('<code>href="baba"</code> "baba"');
	wptexturize('<code>curl -s <a href="http://x/">baba</a> | grep sfive | cut -d "\"" -f 10 &gt; topmp3.txt</code>');
	wptexturize('<pre>"baba"<code>"baba"<pre></pre></code>"baba"</pre>');
	wptexturize('("test")');
	wptexturize("('test')");
	wptexturize("('twas)");
	wptexturize('A dog ("Hubertus") was sent out.');
	wptexturize('Here is "<a href="http://example.com">a test with a link</a>"');
	wptexturize("'<strong>Quoted Text</strong>',");
	wptexturize('&nbsp;"Testing"');
}

function perf_run() {
	if ( ! isset($_GET['perf']) )
		return;

	if ( ! function_exists('perf_' . $_GET['perf']) )
		return;

	$repeat = !empty( $_GET['repeat'] ) ? (int) $_GET['repeat'] : 1;

	timer_start();

	for ( $i = 0; $i < $repeat; $i++ ) {
		call_user_func('perf_' . $_GET['perf']);
	}

	timer_stop(1);

	exit;
}
add_action('init', 'perf_run');
