Hi all,
is there a method to use threads to set up a timer for a long time(about 8 hours)? Thanks for your help.
Hi all,
is there a method to use threads to set up a timer for a long time(about 8 hours)? Thanks for your help.
Can't you just implement a normal timer (google this) and start that in a new thread and when it has elapsed you do something?
Thanks shakti, i googled a lot for it but nothing? give me a link or better a sample .
I won't give a sample but depending on what you need you probably want to look into the functions and data-structures provided by time.h for inspiration on how a simple timer can be built. It really all depends on how you expect to use it..do you just want a timer that times how fast a piece of code executes or do you want to use the timer to idle the program, what precision do you need and so on.
5 minutes (at MOST!) of Google is "a lot"? Puhleeze!
Thanks, but i need a clear answer!!! thanks for the help and effort.
We have answered you! You need to show some effort, we will not do your entire work!
??!! i'm not asking for doing something, i'm just asking for a link or an idea (some PSEUDO CODE) not a working code! it's amazing that when people know something don't share it with other! When i logged to this forum the first thing i do is to see if there a question that i can answer if so i do my best to give the answer and it's the responsability of the person who ask the question to see if this manner is good for his knowledge or it's better for him to post and post again and again to better understand.
thanks for those who spend their time trying to help others on this forum without asking any questions.
But this is so trivial a mere 5 minutes on google will help you (the first 6 results to to c+timer pretty much gives you all the info you need).
A part of becoming a good programmer is being able to find and extract information from documentation and references without somebody holding your hand. This is why you sometimes are met with answers like these, simply because they are so trivial that a mere search and some reading would do.
It's may be a trivial thing for you but not for me, it's the reason why i'm asking. Any way thanks for your time.
Thanks.
Then make an attempt and ask specific questions about specific problems you have. You need to show some effort to get some back.
That's what i want thanks , topic is now closed, great answer, and amazing philosophy.