I’ve wrote some functions like
openWebPage()
fillInforMation()
submitNow()
they called by button click event.
how ever I want to do it in a thread,Then I created a structure which contain those function and then pass it as parameter to boost::thread,it works fine,every function gets called.
but if the internet is slow,some function will not success,so what I want to do is something like this:
openWebPage()
wait 20 seconds
fillInformation()
wait 5 seconds
submitnow()
that wait function,how to do it in boost::thread? by the way I am using gcc and gtk if that helps.
To answer you question, the function you are looking for is
boost::this_thread::sleep.But if there is an error in one of you functions, is it really okay to continue? For example if
openWebPagefails, can you really use the other functions? Errors should never be ignored as that may cause further errors down the road.