Are StopWatch.ElapsedTicks and StopWatch.Elapsed.Ticks always the same?

后端 未结 2 611
我在风中等你
我在风中等你 2021-01-01 09:57

What does ElapsedTicks and Elapsed.Ticks in the StopWatch class mean? When could the meaning be different than intended?

2条回答
  •  甜味超标
    2021-01-01 10:43

    I just found out that ElapsedTicks in the StopWatch class doesn't mean real "ticks" if StopWatch.isHighResolution is True

    Note(if isHighResolution is True):

    Stopwatch ticks are different from DateTime..::.Ticks. Each tick in the DateTime..::.Ticks value represents one 100-nanosecond interval. Each tick in the ElapsedTicks value represents the time interval equal to 1 second divided by the Frequency.

    You can do the math above or it seem you can use StopWatch.Elapsed.Ticks instead of StopWatch.ElapsedTicks

提交回复
热议问题