Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 891463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:53:43+00:00 2026-05-15T13:53:43+00:00

I’m rewriting a VB 6.0 program in C# .Net for an internship. It measures

  • 0

I’m rewriting a VB 6.0 program in C# .Net for an internship. It measures incoming data from a precision grinding machine and gives a readout on its accuracy. A lot of the meat of the program is done within a Timer object, with an interval of 10. The program is unfinished, so it has yet to be tested on an actual machine, but I have a Debug simulation that generates a Sin wave (to ensure that, upon receiving data, the dials and numbers all operate as expected).

I’m using WinForms, and the Timer object, not System.Threading.Timer (though if that sounds like a better option, by all means I’m open to using it). I used System.Diagnostics.Stopwatch ElapsedTicks to time just how many ticks it was taking the Timer to cycle from beginning to end, on average. On Form1, the timer generally takes around 19500 ticks. When it switches to Form2, that drops to around 15000, and even lower to 11000 on Form3.

Now, it makes sense that Form3 is evaluating faster, because it skips some parts of the code that don’t need to be run. Form2 should be running the entire Timer. What’s stranger is that after switching to Form2, and then back to Form1, the timer remains at around 16000, and gets slightly faster every time I switch between forms. The interval always stays a constant 10.

I’m not sure what’s doing it, or how I can force it to run at a constant rate. Furthermore, I’m not sure if it even matters. It’s been bugging me immensely, but I’m not sure it will matter that it’s evaluating faster when it program is receiving actual data from a machine.

If anyone has any suggestions as to why the timer is acting the way it is, or how to limit it to run at a constant rate, or to even if I should worry about it or not, they would be greatly appreciated.

Thanks for your time

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:53:44+00:00Added an answer on May 15, 2026 at 1:53 pm

    When you mean cycle, do you mean the time it takes to execute the event logic or the time between timer ticks? The UI timer may not be that accurate because it operates on the UI thread.

    To be honest, it sounds like you need real-time requirements, something that you aren’t going to get easily (or, at all). You also have to contend with garbage collection arbitrarily running throughout.

    I wouldn’t worry about it, though I would possibly use a threaded timer, not a UI timer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to select an H1 element which is the second-child in its group
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.