c# - Why is the Console pausing my code when I click on the scrollbar -
run code in 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 steady numbers like
- ...
- 62.234235
- 62.123134
- 62.589342
- 62.423423
- ...
and while running hold scroll button seconds. while holding button outputs should stop cause thread sleeping....
the next output when u release smt. this:
- ...
- 62.234235
- 62.123134 <--- holding scroll button
- 2540.342112 <--- release
- 62.589342
- 62.423423
- ...
now question: there way stop console telling thread goodnight story when scrolling?
no, there no way.
console.writeline
blocking operation. when scroll, preventing call complete, stopwatch continues run.
the number seeing when release scroll 50 + how long keep holding scrolling button.
Comments
Post a Comment