From f2b9a9c2b0a3d7af3b56df9ae09db8a3b2d8506c Mon Sep 17 00:00:00 2001 From: emmauss Date: Thu, 6 Feb 2020 11:25:47 +0000 Subject: Render Profiler in GUI (#854) * move profiler output to gui * addressed commits, rebased * removed whitespaces --- Ryujinx.Debugger/Profiler/ProfileSorters.cs | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Ryujinx.Debugger/Profiler/ProfileSorters.cs (limited to 'Ryujinx.Debugger/Profiler/ProfileSorters.cs') diff --git a/Ryujinx.Debugger/Profiler/ProfileSorters.cs b/Ryujinx.Debugger/Profiler/ProfileSorters.cs new file mode 100644 index 00000000..2b730af5 --- /dev/null +++ b/Ryujinx.Debugger/Profiler/ProfileSorters.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +namespace Ryujinx.Debugger.Profiler +{ + public static class ProfileSorters + { + public class InstantAscending : IComparer> + { + public int Compare(KeyValuePair pair1, KeyValuePair pair2) + => pair2.Value.Instant.CompareTo(pair1.Value.Instant); + } + + public class AverageAscending : IComparer> + { + public int Compare(KeyValuePair pair1, KeyValuePair pair2) + => pair2.Value.AverageTime.CompareTo(pair1.Value.AverageTime); + } + + public class TotalAscending : IComparer> + { + public int Compare(KeyValuePair pair1, KeyValuePair pair2) + => pair2.Value.TotalTime.CompareTo(pair1.Value.TotalTime); + } + + public class TagAscending : IComparer> + { + public int Compare(KeyValuePair pair1, KeyValuePair pair2) + => StringComparer.CurrentCulture.Compare(pair1.Key.Search, pair2.Key.Search); + } + } +} -- cgit v1.2.3