• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Multithreaded Pulse Train

I was wondering the most efficient way to produce a "pulse train" in a .NET program.
I need an adjustable on off pulse, typically 1000ms on 500 ms off to drive a flashing output. My thought was to use VB.NET Background worker and put the thread to sleep for ech of the time and use the update progress method o flip a bolean that the rest of my program can read.

Is there a more efficient way?

(.NET 2.0 Framework)
0
moldie
Asked:
moldie
  • 2
1 Solution
 
Jens FiedererTest Developer/ValidatorCommented:
How accurate do you need to be?  A thread that takes action between sleeps would be the standard way to do this...but be aware that Windows is NOT a realtime OS, and there is no reason to expect these "pulses" to be very accurate.  If a few ms either way makes a difference, you are going to have to use an external device.
0
 
moldieAuthor Commented:
The time interval is not critical as I only flash an external lamp to warn an operator so he wouldn't care if it's 500 or 800ms flash. I did however wanted a slow flash rate and a quicker flash rate say 1500/500 and 300/3000 on/off and was a bit concerned about how much loading I would place onto the processor, as my application is a "bolt on" to a heavier application. If there is a better wat or is this aproach acceptable?
0
 
Jens FiedererTest Developer/ValidatorCommented:
You are in good shape.   A thread that spends practically all its time sleeping is very little stress on the system.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now