Merge pull request #545 from daemitus/countStuff

This commit is contained in:
goaaats 2021-09-08 03:21:55 +02:00 committed by GitHub
commit 4f8b0972c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View file

@ -120,6 +120,11 @@ namespace Dalamud.Interface
set => Service<InterfaceManager>.Get().OverrideGameCursor = value;
}
/// <summary>
/// Gets the count of Draw calls made since plugin creation.
/// </summary>
public ulong FrameCount { get; private set; } = 0;
/// <summary>
/// Gets or sets a value indicating whether statistics about UI draw time should be collected.
/// </summary>
@ -283,6 +288,8 @@ namespace Dalamud.Interface
this.hasErrorWindow = true;
}
this.FrameCount++;
if (DoStats)
{
this.stopwatch.Stop();

View file

@ -48,6 +48,9 @@ namespace Dalamud.Plugin
this.configs = Service<PluginManager>.Get().PluginConfigs;
this.Reason = reason;
this.LoadTime = DateTime.Now;
this.LoadTimeUTC = DateTime.UtcNow;
this.GeneralChatType = configuration.GeneralChatType;
this.Sanitizer = new Sanitizer(dataManager.Language);
if (configuration.LanguageOverride != null)
@ -83,6 +86,21 @@ namespace Dalamud.Plugin
/// </summary>
public PluginLoadReason Reason { get; }
/// <summary>
/// Gets the time that this plugin was loaded.
/// </summary>
public DateTime LoadTime { get; }
/// <summary>
/// Gets the UTC time that this plugin was loaded.
/// </summary>
public DateTime LoadTimeUTC { get; }
/// <summary>
/// Gets the timespan delta from when this plugin was loaded.
/// </summary>
public TimeSpan DeltaLoadTime => DateTime.Now - this.LoadTime;
/// <summary>
/// Gets the directory Dalamud assets are stored in.
/// </summary>