Rx minimal time accuracy

2015/09/05

no comments

this post discuss basic behavior of RX which you better be aware of.

in general RX’s time’s based operator relay on Timers therefore the

minimal accuracy of those operator depend on the timer  accuracy

which is around 15 millisecond.

 

the following snippets demonstrate it:

Code Snippet
  1. Observable.Interval(TimeSpan.FromMilliseconds(1))
  2.     .TimeInterval()
  3.     .Subscribe(v => Console.WriteLine(v.Interval.Milliseconds));

and this one:

Code Snippet
  1. var sw = Stopwatch.StartNew();
  2. var tmr = new Timer(state =>
  3. {
  4.     long milli = sw.ElapsedMilliseconds;
  5.     sw.Restart();
  6.     Console.WriteLine(milli);
  7. }, null, 1, 1);

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*