feat: expose framework timing

This commit is contained in:
Raymond 2021-09-07 21:56:52 -04:00
parent bd48297745
commit 7768a9c1d9

View file

@ -92,6 +92,16 @@ namespace Dalamud.Game
/// </summary>
public FrameworkAddressResolver Address { get; }
/// <summary>
/// Gets the last time the Framework Update event was triggered.
/// </summary>
public DateTime LastUpdate { get; private set; } = DateTime.MinValue;
/// <summary>
/// Gets the delta between the last Framework Update and the currently executing one.
/// </summary>
public TimeSpan UpdateDelta { get; private set; } = TimeSpan.Zero;
/// <summary>
/// Gets or sets a value indicating whether to dispatch update events.
/// </summary>
@ -173,6 +183,10 @@ namespace Dalamud.Game
if (this.DispatchUpdateEvents)
{
var now = DateTime.Now;
this.DeltaFrameworkUpdate = now - this.LastUpdate;
this.LastUpdate = now;
try
{
if (StatsEnabled && this.Update != null)