using System.Collections; namespace X10D.Unity; /// /// Represents a yield instruction which waits for a given amount of time, as provided by a . /// public readonly struct WaitForTimeSpanRealtime : IEnumerator { private readonly DateTime _expectedEnd; /// /// Initializes a new instance of the struct. /// /// The duration of the pause. public WaitForTimeSpanRealtime(TimeSpan duration) { _expectedEnd = DateTime.Now + duration; } /// public object Current { get => DateTime.Now; } /// public bool MoveNext() { return DateTime.Now < _expectedEnd; } /// public void Reset() { } }