|
Can I ask a question about C#?
The best way to guarantee a loss is to quit - Morgan Freeman |
|
blox6137Join Date: 2008-11-23 Post Count: 1109 |
Sure. |
|
L0cky2013Join Date: 2012-07-30 Post Count: 1446 |
Sure. |
|
UncleTazJoin Date: 2009-08-19 Post Count: 12795 |
Sure. |
|
|
Umm ok... I've been using C# for a while but stupidly enough.. I don't know how to make make a program wait for 5 seconds.
In Lua: wait(5) -- easy
The best way to guarantee a loss is to quit - Morgan Freeman |
|
blox6137Join Date: 2008-11-23 Post Count: 1109 |
I believe this is C#'s wait method or whatever:
Thread.Sleep(1000);
the number is in milliseconds, so keep that in mind. |
|
|
That will make the program stop responding for 5 seconds :/.
The best way to guarantee a loss is to quit - Morgan Freeman |
|
blox6137Join Date: 2008-11-23 Post Count: 1109 |
So if you wanted it to wait for 5 seconds, it would be:
Thread.Sleep(5000);
I don't 100% know though, as I hate C 'based' languages.
Languages such as, C, C# Objective C, and C++. |
|
|
yeah.. but that will make the whole program stop.. (stop responding)
The best way to guarantee a loss is to quit - Morgan Freeman |
|
blox6137Join Date: 2008-11-23 Post Count: 1109 |
Yeah, I don't really know then. Like I said, hate C 'based' languages. |
|
VuvaJoin Date: 2010-01-22 Post Count: 1102 |
I'm not sure of the technicality of it but it's because all of your code is executing under a single thread. Well, that's my guess anyways. |
|
methinoJoin Date: 2008-08-25 Post Count: 289 |
DateTime Tthen = DateTime.Now;
do
{
//derp
} while (Tthen.AddSeconds(5) > DateTime.Now); //5 seconds
|
|
|
You can ask, but you'd probably get more answers on Stack Exchange. |
|