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 some stable numbers, such as
- ...
- 62.234235
- 62.123134
- 62.589342
- 62.423423
- ...
And while he holds the scroll button for a few seconds. While you are holding the button, the outputs should stop because the thread has slept ....
The next exit when u release is smt. eg:
- ...
- 62.234235
- 62.123134 <--- Holding the scroll button
- 2540.342112 <--- Release
- 62.589342
- 62.423423
- ...
Now my question is: Is there a way for the Console not to tell my stream a draw when I scroll?
source
share