I am using a Mountaineer board to simulate input going into a pulse counter and need moderately accurate timing on the generation of the pulse train. More importantly, I need to accurately control the total number of pulses sent to the device.
The specific requirements are to generate a fixed number of pulses, between 1 and 125, during a 250 ms time window.
At any given time, I have at least one other thread running - performing a NetworkStream.Read call - which may be blocking.
Since the Gadgeteer.Timer class is not intended for this level of timing accuracy, what are my other options?
Should I use a blocking function call that toggles the pin state with for loops? If I am only generating 3 - 4 concurrent threads, can I assume a specific thread will be active a certain amount of time?