seek() does nothing here
[mediawiki.git] / includes / ProfilerSimpleText.php
blobe1cd921036d89aebcd188420073d5f083b69bc88
1 <?php
2 /* The least sophisticated profiler output class possible, view your source! :)
4 Put it to StartProfiler.php like this:
6 require_once( dirname(__FILE__).'/includes/ProfilerSimpleText.php' );
7 $wgProfiler = new ProfilerSimpleText;
8 $wgProfiler->visible=true;
11 require_once(dirname(__FILE__).'/ProfilerSimple.php');
12 class ProfilerSimpleText extends ProfilerSimple {
13 public $visible=false; /* Show as <PRE> or <!-- ? */
14 function getFunctionReport() {
15 if ($this->visible) print "<pre>";
16 else print "<!--\n";
17 uasort($this->mCollated,array('self','sort'));
18 array_walk($this->mCollated,array('self','format'));
19 if ($this->visible) print "</pre>\n";
20 else print "-->\n";
22 /* dense is good */
23 static function sort($a,$b) { return $a['real']<$b['real']; /* sort descending by time elapsed */ }
24 static function format($item,$key) { printf("%3.6f %6d - %s\n",$item['real'],$item['count'], $key); }