diff options
| author | emmauss <emmausssss@gmail.com> | 2020-02-06 11:25:47 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-06 11:25:47 +0000 |
| commit | f2b9a9c2b0a3d7af3b56df9ae09db8a3b2d8506c (patch) | |
| tree | 7c4a0019c1c904397927567a0ad0685299cce1eb /Ryujinx.Debugger/Profiler/ProfileSorters.cs | |
| parent | db9f8f999f2c9a50e25685424271735ed3538539 (diff) | |
Render Profiler in GUI (#854)
* move profiler output to gui
* addressed commits, rebased
* removed whitespaces
Diffstat (limited to 'Ryujinx.Debugger/Profiler/ProfileSorters.cs')
| -rw-r--r-- | Ryujinx.Debugger/Profiler/ProfileSorters.cs | 32 |
1 files changed, 32 insertions, 0 deletions
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<KeyValuePair<ProfileConfig, TimingInfo>> + { + public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2) + => pair2.Value.Instant.CompareTo(pair1.Value.Instant); + } + + public class AverageAscending : IComparer<KeyValuePair<ProfileConfig, TimingInfo>> + { + public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2) + => pair2.Value.AverageTime.CompareTo(pair1.Value.AverageTime); + } + + public class TotalAscending : IComparer<KeyValuePair<ProfileConfig, TimingInfo>> + { + public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2) + => pair2.Value.TotalTime.CompareTo(pair1.Value.TotalTime); + } + + public class TagAscending : IComparer<KeyValuePair<ProfileConfig, TimingInfo>> + { + public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2) + => StringComparer.CurrentCulture.Compare(pair1.Key.Search, pair2.Key.Search); + } + } +} |
