Why is the Console pausing my code when I click on the scrollbar
.net, c#
Solution
No, there is no way.
`Console.WriteLine` is a blocking operation. When you scroll, you are preventing this call to complete, but the stopwatch continues to run.
The number you are seeing when you release the scroll is basically 50 + How long you keep holding the scrolling button.
Problem
Run this code in a C# Console Application: ``` long last = 0; long curr = Stopwatch.GetTimestamp(); while (true) { last = curr; curr = Stopwatch.GetTimestamp(); var delta = ((curr - last) / (float)Stopwatch.Frequency) * 1000; Console.WriteLine(delta); Thread.Sleep(50); } ``` This source should print out some steady numbers like - ... - 62.234235 - 62.123134 - 62.589342 - 62.423423 - ... And while this is running hold the scroll button for some seconds. While you are holding the button the outputs should stop cause the Thread is sleeping.... The next output when u release is smt. like this: - ... - 62.234235 - 62.123134 <--- Holding the Scroll button - 2540.342112 <--- Release - 62.589342 - 62.423423 - ... Now my question: Is there a way to stop the Console from telling my Thread a goodnight story when I am scrolling?