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

  • Home
  • SEARCH
  • 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 7896789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:59:05+00:00 2026-06-03T07:59:05+00:00

I have a piece of code (.NET4 C#) that should run in tight loop

  • 0

I have a piece of code (.NET4 C#) that should run in tight loop – other threads asynchronously serve information to the thread with this loop and process it’s commands. The code is in average fast enough (100 – 200 microseconds) but about once every 2 seconds it takes more, usually around 15ms.

These peaks do not much alter the average but I’d like to find in which parts of code they happen – I don’t care about the average but rather about the worst-case execution time. Are there any tools to gather such info? I have tried dotTrace but with no luck, it shows just the average and I’d like to ignore most of the cases.

There is always an option to write my own profilers using stopwatch etc. but deploying these all over the code is rather clumsy.

Note: I know that I should expect some context-switches causing these peaks with busy loop but the code is ran on 24-core server dedicated to this application. Therefore, I hope I can somehow reduce them to minimum.

  • 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-06-03T07:59:06+00:00Added an answer on June 3, 2026 at 7:59 am

    Did you also try ANTS? Link: http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/
    The figures it gives you are averaged to the selected region. However, when you select a stack-trace the green bars shown at the top of the view for the time-line show you where that stack view was executed; so you can click on each one and view the figures (timings etc) for each execution of the stack.
    It takes a little bit of manual comparing but it is possible.

    Not sure if the profiler you tried has something similar, YourKits is also another popular profiler, again I do not know if it offers something like this.

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

Sidebar

Related Questions

I have a piece of code that I can run in four ways Debug
I have a piece of code here that i really could use some help
I have this piece of code that does not work: public CartaoCidadao() { InitializeComponent();
I have time-critical piece of code in my app. I made the thread which
i have piece of code that works fine on my local test server but
I have piece of javascript code, which should process when the browser window is
I have a piece of code similar to the below that I have been
I have a piece of code that tests for the existence of a variable,
I have piece of Code in Form that works: public class Form1 : System.Windows.Forms.Form
I have a piece of code from an exam paper that I'm doing for

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.