namespace StardewModdingAPI.Framework.PerformanceMonitoring { /// The context for an alert. internal readonly struct AlertContext { /********* ** Accessors *********/ /// The source which triggered the alert. public string Source { get; } /// The elapsed milliseconds. public double Elapsed { get; } /********* ** Public methods *********/ /// Construct an instance. /// The source which triggered the alert. /// The elapsed milliseconds. public AlertContext(string source, double elapsed) { this.Source = source; this.Elapsed = elapsed; } /// Get a human-readable text form of this instance. public override string ToString() { return $"{this.Source}: {this.Elapsed:F2}ms"; } } }