From 3e4415a5215dcd5527095d67836148d9ff2671ce Mon Sep 17 00:00:00 2001 From: Alex Schmitz Date: Wed, 23 Jun 2021 17:57:44 +0200 Subject: [PATCH] Sort timeline elements by start and duration. --- system/Debug/Toolbar.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php index 1acf00e73aaf..a954832b529b 100644 --- a/system/Debug/Toolbar.php +++ b/system/Debug/Toolbar.php @@ -245,6 +245,12 @@ protected function collectTimelineData($collectors): array } // Sort it + $sortArray = [ + array_column($data, 'start'), SORT_NUMERIC, SORT_ASC, + array_column($data, 'duration'), SORT_NUMERIC, SORT_DESC, + &$data + ]; + array_multisort(...$sortArray); return $data; }