Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Timers


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-03-2007, 11:34 AM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 22
Send a message via Skype™ to davelew1s
Default Timers

I'm writing an app which uses the serial ports, so far it almost works, using Timers..I have a few questions on Timers:-
1...Is it OK to use more than 1 timer at a time, it does work but is good/bad
2...If more than 1 is used when do they fire..are they connected in any way or does it depend on when they are Enabled?
3...Is it good or bad to jump to a Sub from within a timer, if you do does the timer still fire or is it suspended until it is exited..similar if you stay in a timer longer then the interval does it still fire?
Anyone got any thoughts on these?
Dave.
Reply With Quote
  #2 (permalink)  
Old 08-03-2007, 11:52 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

1. There is no problem with using several timers.
2. They are not connected in any way.
Theoretically, each one will wait for its interval and then fire.
However timers can't fire when the processor is busy and not handling internal messages.
For example if you create an endless loop, timers will not fire at all.
That is unless you use the DoEvents keyword in the loop.
3. As written above, the timer will only fire after finishing the sub (and any other code in the Timer_Tick event).

You should set an interval that is large enough for the processor to finish all the code, otherwise it will just run slower.
Reply With Quote
  #3 (permalink)  
Old 08-03-2007, 05:36 PM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 22
Send a message via Skype™ to davelew1s
Default

Thanks Erel that makes things a lot clearer.
Dave.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
timers during heavy load stevefan Questions & Help Needed 3 01-18-2008 09:55 AM
two timers won't work sloopa Bug Reports 1 05-22-2007 07:21 AM


All times are GMT. The time now is 03:50 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0