display in ms rather than ticks
This commit is contained in:
parent
5ba0b07180
commit
6cbb328405
4 changed files with 10 additions and 9 deletions
|
@ -16,8 +16,8 @@ namespace Ryujinx.Profiler
|
||||||
$"{time.Key.SessionGroup}," +
|
$"{time.Key.SessionGroup}," +
|
||||||
$"{time.Key.SessionItem}," +
|
$"{time.Key.SessionItem}," +
|
||||||
$"{time.Value.Count}," +
|
$"{time.Value.Count}," +
|
||||||
$"{profile.ConvertTicksToMS(time.Value.AverageTime)}," +
|
$"{Profile.ConvertTicksToMS(time.Value.AverageTime)}," +
|
||||||
$"{profile.ConvertTicksToMS(time.Value.TotalTime)}\r\n";
|
$"{Profile.ConvertTicksToMS(time.Value.TotalTime)}\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure file directory exists before write
|
// Ensure file directory exists before write
|
||||||
|
|
|
@ -62,11 +62,6 @@ namespace Ryujinx.Profiler
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double ConvertTicksToMS(long ticks)
|
|
||||||
{
|
|
||||||
return (((double)ticks) / Stopwatch.Frequency) * 1000.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetSession()
|
public string GetSession()
|
||||||
{
|
{
|
||||||
// Can be called from multiple threads so locked to ensure no duplicate sessions are generated
|
// Can be called from multiple threads so locked to ensure no duplicate sessions are generated
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Ryujinx.Profiler
|
namespace Ryujinx.Profiler
|
||||||
{
|
{
|
||||||
|
@ -65,6 +66,11 @@ namespace Ryujinx.Profiler
|
||||||
return ProfileInstance.GetSession();
|
return ProfileInstance.GetSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static double ConvertTicksToMS(long ticks)
|
||||||
|
{
|
||||||
|
return (((double)ticks) / Stopwatch.Frequency) * 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
public static Dictionary<ProfileConfig, TimingInfo> GetProfilingData()
|
public static Dictionary<ProfileConfig, TimingInfo> GetProfilingData()
|
||||||
{
|
{
|
||||||
if (!ProfilingEnabled())
|
if (!ProfilingEnabled())
|
||||||
|
|
|
@ -213,8 +213,8 @@ namespace Ryujinx
|
||||||
foreach (var entry in profileData)
|
foreach (var entry in profileData)
|
||||||
{
|
{
|
||||||
float y = yOffset + Height - (lineHeight + 2) * (verticalIndex++ + 1);
|
float y = yOffset + Height - (lineHeight + 2) * (verticalIndex++ + 1);
|
||||||
fontService.DrawText($"{entry.Value.AverageTime:F3}", xOffset, y, lineHeight);
|
fontService.DrawText($"{Profile.ConvertTicksToMS(entry.Value.AverageTime):F3}", xOffset, y, lineHeight);
|
||||||
fontService.DrawText($"{entry.Value.LastTime:F3}", columnSpacing + 100 + xOffset, y, lineHeight);
|
fontService.DrawText($"{Profile.ConvertTicksToMS(entry.Value.LastTime):F3}", columnSpacing + 100 + xOffset, y, lineHeight);
|
||||||
}
|
}
|
||||||
GL.Disable(EnableCap.ScissorTest);
|
GL.Disable(EnableCap.ScissorTest);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue