I use this code inside a buttoncontrol. I wonder if it is possible after the first if-statement to "Pause" for 1 second before it continues with the second if-statement.
I have heard something about sleep(n) where n stands for milliseconds.
But the compiler doesn´t recognice this syntax.
int i = 5;
if( i > 0 )
i = 2;
sleep(100) //This does not work
if( i == 2 )
i = 0;
In Windows, there is a "Sleep()" function - not sure if it's called something else in C# tho'.
I am not sure where to post this question but I use VC++.
I have tested to write both Sleep(100) and sleep(100).
I tried to #include <windows.h> but it seems that this header wasn´t found.
Perhaps this is what you want: http://msdn.microsoft.com/en-us/libr...ep(VS.71).aspx
Originally Posted by Coding
Yes, thank you...
I tried Thread::Sleep(1000) and it worked fine.
This is a C# board....assuming you are coding in C# then of course the statement #include <windows.h> will not work.