Skip to content

Instantly share code, notes, and snippets.

@andersonimes
Created July 3, 2012 02:05
Show Gist options
  • Save andersonimes/3037067 to your computer and use it in GitHub Desktop.
Save andersonimes/3037067 to your computer and use it in GitHub Desktop.
[Rx]Event rate smoothing operator called "StepInterval"
//Source: http://stackoverflow.com/a/11285920/3244
public static IObservable<T> StepInterval<T>(this IObservable<T> source, TimeSpan minDelay)
{
return source.Select(x =>
Observable.Empty<T>()
.Delay(minDelay)
.StartWith(x)
).Concat();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment