|
-
Feb 6th, 2015, 11:05 AM
#1
Thread Starter
Frenzied Member
Issues using BGW for graphing
So I'm converting VB6 code that is littered with Do Loops, some doing nothing but waiting various amounts of time for hardware to stabilize and some reading an analog channel until a certain value is met. In general, UI responsiveness is not important for most of these (nothing the operator can do while test is running) so can I just use Thread.Sleep and be done with it? Even though it will freeze the UI, it seems so much simpler than trying to split all the following code into a timer, checking for state variables, etc.
I originally posted this question on JMC's Pause thread but moved it here. I may try to split off the main one that has the DoEvents call into another thread so the real-time graph will display better though my tests indicate that should be fine as is (though it will run the CPU more than needed, of course). The VB6 code was using a progress bar rather than graph.
The VB6 code pegged the CPU at 100% for most of the test as one would expect. The .Net code will run on much newer hardware (dual core even - LOL).
Last edited by topshot; Feb 6th, 2015 at 06:05 PM.
Reason: Changed title to reflect thread drift
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|