From c04747375f2dbc6b8ca7bf778af27f2e33929d38 Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 7 Sep 2021 10:00:38 -0400 Subject: [PATCH] feat: expose loading time/delta --- Dalamud/Plugin/DalamudPluginInterface.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Dalamud/Plugin/DalamudPluginInterface.cs b/Dalamud/Plugin/DalamudPluginInterface.cs index 9fae3c2fc..40894ea25 100644 --- a/Dalamud/Plugin/DalamudPluginInterface.cs +++ b/Dalamud/Plugin/DalamudPluginInterface.cs @@ -48,6 +48,9 @@ namespace Dalamud.Plugin this.configs = Service.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 /// public PluginLoadReason Reason { get; } + /// + /// Gets the time that this plugin was loaded. + /// + public DateTime LoadTime { get; } + + /// + /// Gets the UTC time that this plugin was loaded. + /// + public DateTime LoadTimeUTC { get; } + + /// + /// Gets the timespan delta from when this plugin was loaded. + /// + public TimeSpan DeltaLoadTime => DateTime.Now - this.LoadTime; + /// /// Gets the directory Dalamud assets are stored in. ///