1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-22 13:45:02 +00:00

Converted performance timeing comments and headers to use milliseconds

This commit is contained in:
Starbeamrainbowlabs 2016-04-30 12:00:48 +01:00
parent e86c67dcad
commit 1bf49fe6ae
4 changed files with 9 additions and 9 deletions

View file

@ -925,7 +925,7 @@ else
{
$pageindex_read_start = microtime(true);
$pageindex = json_decode(file_get_contents($paths->pageindex));
header("x-pageindex-decode-time: " . round(microtime(true) - $pageindex_read_start, 6) . "ms");
header("x-pageindex-decode-time: " . round((microtime(true) - $pageindex_read_start)*1000, 3) . "ms");
}
//////////////////////////
@ -1072,7 +1072,7 @@ class page_renderer
</head>
<body>
{body}
<!-- Took {generation-time-taken} seconds to generate -->
<!-- Took {generation-time-taken}ms to generate -->
</body>
</html>
";
@ -1191,7 +1191,7 @@ class page_renderer
], [
], $result);
$result = str_replace("{generation-time-taken}", microtime(true) - $start_time, $result);
$result = str_replace("{generation-time-taken}", round((microtime(true) - $start_time)*1000, 2), $result);
return $result;
}
public static function render_main($title, $content)
@ -4258,7 +4258,7 @@ register_module([
}
}
$content .= "\n\t\t<!-- Took " . (microtime(true) - $parsing_start) . " seconds to parse page source -->\n";
$content .= "\n\t\t<!-- Took " . round((microtime(true) - $parsing_start) * 1000, 2) . "ms to parse page source -->\n";
// Prevent indexing of this page if it's still within the noindex
// time period

View file

@ -509,7 +509,7 @@ else
{
$pageindex_read_start = microtime(true);
$pageindex = json_decode(file_get_contents($paths->pageindex));
header("x-pageindex-decode-time: " . round(microtime(true) - $pageindex_read_start, 6) . "ms");
header("x-pageindex-decode-time: " . round((microtime(true) - $pageindex_read_start)*1000, 3) . "ms");
}
//////////////////////////
@ -656,7 +656,7 @@ class page_renderer
</head>
<body>
{body}
<!-- Took {generation-time-taken} seconds to generate -->
<!-- Took {generation-time-taken}ms to generate -->
</body>
</html>
";
@ -775,7 +775,7 @@ class page_renderer
], [
], $result);
$result = str_replace("{generation-time-taken}", microtime(true) - $start_time, $result);
$result = str_replace("{generation-time-taken}", round((microtime(true) - $start_time)*1000, 2), $result);
return $result;
}
public static function render_main($title, $content)

View file

@ -176,7 +176,7 @@
"author": "Starbeamrainbowlabs",
"description": "Allows you to view pages. You really should include this one.",
"id": "page-view",
"lastupdate": 1462012572,
"lastupdate": 1462013968,
"optional": false
},
{

View file

@ -100,7 +100,7 @@ register_module([
}
}
$content .= "\n\t\t<!-- Took " . (microtime(true) - $parsing_start) . " seconds to parse page source -->\n";
$content .= "\n\t\t<!-- Took " . round((microtime(true) - $parsing_start) * 1000, 2) . "ms to parse page source -->\n";
// Prevent indexing of this page if it's still within the noindex
// time period