Yadz
Active Member
- Feb 20, 2015
- 174
- 25
So I'm new to C# and were wondering: Whats the best way to keep a thread alive in C#? For example if I want to constantly check if a car got less than 0 litres fuel (bad example), how should I do it in a thread? The only way I can think of is using is a while(true) loop with an if statement in it (in this case).
Also could the while(true) loop affect the application in a bad way? What if I got a while(true) loop in a thread with 50 if statements in it? Is it bad to do that?
Also could the while(true) loop affect the application in a bad way? What if I got a while(true) loop in a thread with 50 if statements in it? Is it bad to do that?