I want to make an application to execute several instructions to pass the following instruction has to wait a few milliseconds.
Such that:
while(true){
send("OK");
wait(100); //or such delay(100);
}
Is it possible in C#?
Thread.Sleep(100);
will do the trick. This can be found in the System.Threading
namespace.
You can use the Thread.Sleep() method to suspend the current thread for X milliseconds:
// Sleep for five seconds
System.Threading.Thread.Sleep(5000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With