What I need: I have a WPF/Vb.net application and need to delay a section of code from running, otherwise is keeps running.. I'd like to delay this section of code for 3 seconds.
Problem: I am working with a scale and printer and when a weight item is placed on the scale and a button is pushed to auto-print, the printer will keep spitting out paper. But it should only spit out one sheet. The print should only print one sheet. The app is constantly getting data from the scale, so if something is taken off the scale, it won't print anything. But if the item is left on the scale it will continuously printing. So that's why I was think a delay of some sort would work...Because when auto print is set, they are taking items off, paper should print, then item is taken off, and the next time is put on, paper should print and so on and so on,
I tried: System.Threading.Thread.Sleep(ms) - This does not work because this freezes my entire UI.