display in ms rather than ticks

This commit is contained in:
Andy Adshead 2019-01-26 06:38:19 +00:00
commit 6cbb328405
4 changed files with 10 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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<ProfileConfig, TimingInfo> GetProfilingData()
{
if (!ProfilingEnabled())

View file

@ -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);