title: Most efficient way to execute method after DateTime is reached
body: <p>I have a class that is like so:</p>
  
  <pre><code>public sealed class Contract
  {
      public bool isExpired { get; set; }
      public DateTime ExpirationDate { get; set; }
      public void MarkAsExpired()
      {
          this.isExpired = true;
          // Other stuff..
      }
  }
  </code></pre>
  
  <p>What I would like to do is the following: Once <code>ExpirationDate</code> is reached, <code>MarkAsExpired</code> should be called. In case the program closes and by the time it re-opens, <code>ExpirationDate</code> has passed, the same should happen. If <code>isExpired</code> is true nothing should happen at all. </p>
  
  <p>Contracts are modifiable, and new ones are added frequently. My exact expected volume is unknown.</p>
  
  <p>I have already though of a way this could be done via a generalizable extension method for <code>DateTime</code> objects:</p>
  
  <pre><code>var contracts = new List&lt;Contract&gt;();
  foreach (var contract in contracts.Where(contract =&gt; !contract.isExpired))
  {
      contract.ExpirationDate.ExecuteWhenPassed(() =&gt; contract.MarkAsExpired());
  }
  </code></pre>
  
  <p>The problem is in writing the extension method itself. I have already created a working solution:</p>
  
  <pre><code>static void ExecuteWhenPassed(this DateTime date, Action action)
  {
      // Check if date has already passed
      if (date &lt;= DateTime.Now)
      {
          action();
      }
      else
      {
          // Timer will fire when $date is reached
          var timer = new Timer { Interval = date.Subtract(DateTime.Now).TotalMilliseconds, AutoReset = false };
          timer.Elapsed += (s, e) =&gt; action();
          timer.Start();
      }
  }
  </code></pre>
  
  <p>And it works perfectly. However, I'm concerned about its efficiency. Specifically, I'm concerned about the overhead involved in creating a separate timer for each and every <code>Contract</code> instance, of which there might be hundreds that have yet to expire. </p>
  
  <p>Is the overhead significant? If so, what would be a more efficient way of dealing with this issue? </p>
  
  <p>I'm open to completely different approaches, as long as my issue of handling the expiration is solved.</p>