By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

timer outside main in c

P: 2
hello

can anybody explain to me how can i put a timer in my coding but outside main.

i have tried clock and time already

thanks

nalinibh
Jun 21 '07 #1
Share this Question
Share on Google+
2 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
hello

can anybody explain to me how can i put a timer in my coding but outside main.

i have tried clock and time already

thanks

nalinibh
"outside main"? Maybe in a function, but you'll still be accessing that from main (starting, stopping, getting the current time, etc...). You could also use the system time.
Jun 21 '07 #2

weaknessforcats
Expert Mod 5K+
P: 9,197
can anybody explain to me how can i put a timer in my coding but outside main.
You might try putting the timer on its own thread. That way the timer can run on its own. You could write functiions to read the elapsed time om your timer.

This has probably already been done so check your docset carefully before you invest big coding time.
Jun 21 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.