TimingsHandler: added format version

This commit is contained in:
Dylan K. Taylor 2023-04-06 15:08:49 +01:00
parent bf84caa02c
commit 1683aa681d
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -32,6 +32,8 @@ use function implode;
use function spl_object_id;
class TimingsHandler{
private const FORMAT_VERSION = 1;
private static bool $enabled = false;
private static int $timingStart = 0;
@ -88,6 +90,7 @@ class TimingsHandler{
$result[] = "# Entities " . $entities;
$result[] = "# LivingEntities " . $livingEntities;
$result[] = "# FormatVersion " . self::FORMAT_VERSION;
$sampleTime = hrtime(true) - self::$timingStart;
$result[] = "Sample time $sampleTime (" . ($sampleTime / 1000000000) . "s)";