+ 5
How do you create a timer without using "Sleep()"? [SOLVED]
I Would like to make a timer. I used google and the only option I found was to use "sleep()". I also read that it was a bad practice to make you system sleep. If you know how to do it, I appreciate your input.
4 ответов
+ 10
@Dirty That would have issues with different FrameRates.
Perhaps this could be of help?
https://msdn.microsoft.com/en-us/library/dd492468.aspx
+ 5
@Rrestoring
Thank you,
That is exactly what I need.
+ 5
@Dirty
For java, I think it may be something that you would have to import.
+ 2
you could use a variable such as
time=0;
then run a loop with an increase
time++;
and a check for a certain number
if(time>100){
//do something
}
*Ok, my example is in Java. I don't know cop, but the principle remains the same