How about a simple time comparison?
var lastExecution = DateTime.Now; if((DateTime.Now - lastExecution).TotalSeconds >= 3) ...
You can save 'lastExecution' in your trading class. Of course, the code block is not called (elements are not added) with this solution if 3 seconds have not passed.
- // ---------------------------------
Various timer solutions: we add the Windows Forms timer component programmatically. But if you use this solution, you will end up programming hell ,-)
source share