diff --git a/Coroutine/ActiveCoroutine.cs b/Coroutine/ActiveCoroutine.cs
index 354f1cf..e6067c8 100644
--- a/Coroutine/ActiveCoroutine.cs
+++ b/Coroutine/ActiveCoroutine.cs
@@ -33,6 +33,11 @@ namespace Coroutine {
///
public int MoveNextCount { get; private set; }
///
+ /// The maximum amount of time that took.
+ /// This is the maximum amount of time that each "step", or each yield statement, of this coroutine took to execute.
+ ///
+ public TimeSpan MaxMoveNextTime { get; private set; }
+ ///
/// The average amount of time that took.
/// This is the average amount of time that each "step", or each yield statement, of this coroutine took to execute.
///
@@ -88,6 +93,10 @@ namespace Coroutine {
var result = this.enumerator.MoveNext();
this.stopwatch.Stop();
this.TotalMoveNextTime += this.stopwatch.Elapsed;
+ if (this.stopwatch.Elapsed > this.MaxMoveNextTime)
+ {
+ this.MaxMoveNextTime = this.stopwatch.Elapsed;
+ }
this.MoveNextCount++;
if (!result) {
diff --git a/Test/Example.cs b/Test/Example.cs
index 4b29b9a..380d908 100644
--- a/Test/Example.cs
+++ b/Test/Example.cs
@@ -50,7 +50,10 @@ namespace Test {
Console.WriteLine("The time is " + DateTime.Now);
if (first.IsFinished) {
Console.WriteLine("By the way, the first coroutine has finished!");
- Console.WriteLine($"{first.Name} data: {first.MoveNextCount} moves, {first.TotalMoveNextTime} total time, {first.AverageMoveNextTime} average");
+ Console.WriteLine($"{first.Name} data: {first.MoveNextCount} moves, " +
+ $"{first.TotalMoveNextTime.TotalMilliseconds} total time, " +
+ $"{first.AverageMoveNextTime.TotalMilliseconds} average, " +
+ $"{first.MaxMoveNextTime.TotalMilliseconds} maximum");
Environment.Exit(0);
}
}