Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
i'm using serial ports in my program will it interfere with it? and would it ever be okay to use one timer to continuously read from the port? or it is a bad idea
thank you
Posted

1 solution

You can use more than one timer in an app , but it's not a good idea, as timers are scarce resources and you shouldn't use more than you have to. I generally use just one (when I have to) and set it to 1/10th second or similar then use counters within the timer Tick event handler to process multiple uses. A timer on it's own shouldn't interfere with a serial port.

But - no, I wouldn't use a timer to read info from a serial port: instead use the SerialPort.DataReceived event instead.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900