feat: expose loading time/delta

This commit is contained in:
Raymond 2021-09-07 10:00:38 -04:00
parent b0f2486215
commit c04747375f

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>