From 6cbb32840523f0bbf9daa175ea2c42506cd98b9c Mon Sep 17 00:00:00 2001 From: Andy Adshead Date: Sat, 26 Jan 2019 06:38:19 +0000 Subject: [PATCH] display in ms rather than ticks --- Ryujinx.Profiler/DumpProfile.cs | 4 ++-- Ryujinx.Profiler/InternalProfile.cs | 5 ----- Ryujinx.Profiler/Profile.cs | 6 ++++++ Ryujinx.Profiler/UI/ProfileWindow.cs | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Ryujinx.Profiler/DumpProfile.cs b/Ryujinx.Profiler/DumpProfile.cs index dd1543202f..a7d8d5adf1 100644 --- a/Ryujinx.Profiler/DumpProfile.cs +++ b/Ryujinx.Profiler/DumpProfile.cs @@ -16,8 +16,8 @@ namespace Ryujinx.Profiler $"{time.Key.SessionGroup}," + $"{time.Key.SessionItem}," + $"{time.Value.Count}," + - $"{profile.ConvertTicksToMS(time.Value.AverageTime)}," + - $"{profile.ConvertTicksToMS(time.Value.TotalTime)}\r\n"; + $"{Profile.ConvertTicksToMS(time.Value.AverageTime)}," + + $"{Profile.ConvertTicksToMS(time.Value.TotalTime)}\r\n"; } // Ensure file directory exists before write diff --git a/Ryujinx.Profiler/InternalProfile.cs b/Ryujinx.Profiler/InternalProfile.cs index e693ead21b..0d091f5358 100644 --- a/Ryujinx.Profiler/InternalProfile.cs +++ b/Ryujinx.Profiler/InternalProfile.cs @@ -62,11 +62,6 @@ namespace Ryujinx.Profiler return time; } - public double ConvertTicksToMS(long ticks) - { - return (((double)ticks) / Stopwatch.Frequency) * 1000.0; - } - public string GetSession() { // Can be called from multiple threads so locked to ensure no duplicate sessions are generated diff --git a/Ryujinx.Profiler/Profile.cs b/Ryujinx.Profiler/Profile.cs index 2db22f9dca..7408b88c9b 100644 --- a/Ryujinx.Profiler/Profile.cs +++ b/Ryujinx.Profiler/Profile.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; namespace Ryujinx.Profiler { @@ -65,6 +66,11 @@ namespace Ryujinx.Profiler return ProfileInstance.GetSession(); } + public static double ConvertTicksToMS(long ticks) + { + return (((double)ticks) / Stopwatch.Frequency) * 1000.0; + } + public static Dictionary GetProfilingData() { if (!ProfilingEnabled()) diff --git a/Ryujinx.Profiler/UI/ProfileWindow.cs b/Ryujinx.Profiler/UI/ProfileWindow.cs index f3406a04a8..f7dacdc624 100644 --- a/Ryujinx.Profiler/UI/ProfileWindow.cs +++ b/Ryujinx.Profiler/UI/ProfileWindow.cs @@ -213,8 +213,8 @@ namespace Ryujinx foreach (var entry in profileData) { float y = yOffset + Height - (lineHeight + 2) * (verticalIndex++ + 1); - fontService.DrawText($"{entry.Value.AverageTime:F3}", xOffset, y, lineHeight); - fontService.DrawText($"{entry.Value.LastTime:F3}", columnSpacing + 100 + xOffset, y, lineHeight); + fontService.DrawText($"{Profile.ConvertTicksToMS(entry.Value.AverageTime):F3}", xOffset, y, lineHeight); + fontService.DrawText($"{Profile.ConvertTicksToMS(entry.Value.LastTime):F3}", columnSpacing + 100 + xOffset, y, lineHeight); } GL.Disable(EnableCap.ScissorTest);