From 694cca4b21878850ba6131105a0c560fdfbc5f10 Mon Sep 17 00:00:00 2001 From: Drachenkaetzchen Date: Wed, 15 Jan 2020 16:01:35 +0100 Subject: Added documentation for all performance counter methods and members. Refactored the naming of several members and methods to reflect their actual intention. --- src/SMAPI/Framework/PerformanceCounter/AlertContext.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/SMAPI/Framework/PerformanceCounter/AlertContext.cs') diff --git a/src/SMAPI/Framework/PerformanceCounter/AlertContext.cs b/src/SMAPI/Framework/PerformanceCounter/AlertContext.cs index c4a57a49..63f0a5ed 100644 --- a/src/SMAPI/Framework/PerformanceCounter/AlertContext.cs +++ b/src/SMAPI/Framework/PerformanceCounter/AlertContext.cs @@ -1,14 +1,26 @@ namespace StardewModdingAPI.Framework.PerformanceCounter { - public struct AlertContext + /// The context for an alert. + internal struct AlertContext { - public string Source; - public double Elapsed; + /// The source which triggered the alert. + public readonly string Source; + /// The elapsed milliseconds. + public readonly double Elapsed; + + /// Creates a new alert context. + /// The source which triggered the alert. + /// The elapsed milliseconds. public AlertContext(string source, double elapsed) { this.Source = source; this.Elapsed = elapsed; } + + public override string ToString() + { + return $"{this.Source}: {this.Elapsed:F2}ms"; + } } } -- cgit