473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

timer outside main in c

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
2 1391
sicarie
4,677 Expert Mod 4TB
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
9,208 Expert Mod 8TB
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

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

Similar topics

5
by: Michael C# | last post by:
Hi all, I set up a System.Timers.Time in my app. The code basically just updates the screen, but since the processing performed is so CPU-intensive, I wanted to make sure it gets updated...
0
by: brunft | last post by:
I was testing this with .NET Framework 2.0. Exceptions in the Elapsed event handler of a System.Timers.Timer are ignored, they are not handled by the runtime and not reported (when running...
5
by: muzilli | last post by:
Howdy all, I would like to know how can I insert a Timer object in my class library? This timer object will start and stop in a determinated part or event of my program. I know how to do...
12
by: Gina_Marano | last post by:
I have created an array of timers (1-n). At first I just created windows form timers but I read that system timers are better for background work. The timers will just be monitoring different...
10
by: Phil | last post by:
I'm glad to see that in VB 2005 I no longer have to create a form if I want a timer like I did in VB6. I notice though, that there seems to be a Timer component as well as two different timer...
16
by: Peter Oliphant | last post by:
Note that although this involves SAPI, it is more a question about Timers and event handlers. I wrote a Speech Recognize handler (SAPI), and put some code in it to enable a Timer. It would not...
19
by: colin | last post by:
Hi, Im trying to time some parts of my code using the Stopwatch class, but it is so slow, I tried the QueryPerformanceFrequency() but this seems to be just as slow, if I just simply call this...
2
by: Just_a_fan | last post by:
Situation: Timer1 on main form needs to be stopped during a thread action. Programming in second thread: timer1.enabled = false Action:
8
by: Rainer Queck | last post by:
Hello NG, in my application I have a Panel, docked right to my Form. On this panel I draw - cyclic triggered by a System.Winforms.Timer - a bitmap using the Graphics class. using (Graphics g =...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.