At the main of code, I want to create a thread (mythread) and stop main for 20Sec, while this time (20 Sec) mythread is processed and after 20 Sec main is resumed. What should i do?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There should be nothing special you need to do. If you want the main thread to stop, just don’t code it to do any work (or call a sleep function). If you want the thread to be processed, code it to do something. You should be focusing on what work you want your program to do though, not on the threads.