how to execute certain class method no more than once per 100ms?
<p>I'm writing trading software and need to QoS one method that should not be executed more often than 10 times per second. As I'm begginer in C# and almost not familar with libraries I would like to double-check if my code is "optimal". I'm using <code>Stopwatch</code> because I don't know any other timers in C#.</p>

<pre><code>    Stopwatch updateStopwatch = Stopwatch.StartNew();

    private void update()
    {
        if (updateStopwatch.ElapsedMilliseconds &lt; 100)
        {
            Console.WriteLine("!skip update " + updateStopwatch.ElapsedMilliseconds);
            return;
        } else
        {
            Console.WriteLine("!update");
            updateStopwatch.Restart();;
        }
        // do work here
    }
</code></pre>

<p><strong>upd</strong> Now it seems that Stopwatch is pretty good for this task. However probably it would be too slow, if so probably DateTime would be better. sell also <a href="http://stackoverflow.com/questions/2923283/stopwatch-vs-using-system-datetime-now-for-timing-events">Stopwatch vs. using System.DateTime.Now for timing events</a></p>
