title: every minute some C# method invoke (asp.net web api web)
body: <p>I have to run a C# method every minute. I did create a <code>observable</code> for timer and invoking it every 1 minute and this code I'm using in class constructor. Is there any other solution?</p>
  
  <pre><code>public Test()
  {
      IObservable&lt;long&gt; timer = Observable
          .Defer(() =&gt;
      {
          var now = DateTimeOffset.Now;
          var result = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, 0, 0, now.Offset);
          result = result.AddMinutes(((now.Minute / 1) + 1) * 1);
          return Observable.Timer(result, TimeSpan.FromMinutes(1.0));
      });
  
      timer.Subscribe(async x =&gt;
      {
          await InvokeMethod().ConfigureAwait(false);
      });
  }
  </code></pre>