I'am trying to make a piece of code which will work as a non-blocking sleep.
I tried to use the select, but it does not under visual c++
Does any one have an idea about how i can do this ?
I'am trying to make a piece of code which will work as a non-blocking sleep.
I tried to use the select, but it does not under visual c++
Does any one have an idea about how i can do this ?
A blocking function means it returns when it's got what it came for, even if it has to wait to achieve that. So a non-blocking function allows your code to instantly continue execution. The purpose of a sleep function is to temporarily halt your program, therefore you cannot have a function that continues execution and sleeps at the same time.
Unless you have a quantum computer... =o
"The Internet treats censorship as damage and routes around it." - John Gilmore
And what about a delay function, then?
I guess the question is, what do you want to have happen that Sleep() doesn't do for you?
Sounds like you want to continue processing/normal app functioning while waiting for some event to occur (or process to finish).
Have you looked at using a thread with WaitForSingleObjectEx()?
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill