18 using System.Collections;
19 using System.Collections.Generic;
31 private DateTime _lastCallTime;
34 private readonly IEnumerator<T> _enumerator;
35 private readonly TimeSpan _minimumTimeBetweenCalls;
45 _enumerator = enumerator;
46 _timeProvider = timeProvider;
47 _minimumTimeBetweenCalls = minimumTimeBetweenCalls;
61 var currentTime = _timeProvider.GetUtcNow().RoundDown(_minimumTimeBetweenCalls);
62 var timeBetweenCalls = currentTime - _lastCallTime;
65 if (timeBetweenCalls >= _minimumTimeBetweenCalls)
67 if (!_enumerator.MoveNext())
70 _current =
default(T);
75 _lastCallTime = currentTime;
76 _current = _enumerator.Current;
81 _current =
default(T);
104 get {
return _current; }
114 object IEnumerator.Current
116 get {
return _current; }
125 _enumerator.Dispose();