Browse Source

Correct perfdata ms calculation

pull/26/head
Starbeamrainbowlabs 4 years ago
parent
commit
edf52fe3df
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
  1. 8
      logic/PerfFormatter.php

8
logic/PerfFormatter.php

@ -13,10 +13,10 @@ class PerfFormatter { @@ -13,10 +13,10 @@ class PerfFormatter {
public static function format_perf_data($start_init, $start_handle, $start_encode) {
$now = microtime(true);
$time_total = round($now - $start_init, 2);
$time_setup = round($start_handle - $start_init, 2);
$time_handle = round(($start_encode ?? $now) - $start_handle, 2);
$time_encode = round($now - $start_encode, 2);
$time_total = round(($now - $start_init) * 1000, 2);
$time_setup = round(($start_handle - $start_init) * 1000, 2);
$time_handle = round((($start_encode ?? $now) - $start_handle) * 1000, 2);
$time_encode = round(($now - $start_encode) * 1000, 2);
$result = "{$time_total}ms total | {$time_setup}ms setup, {$time_handle}ms handle";
if(!empty($start_encode))

Loading…
Cancel
Save