Is Stopwatch really broken?

Posted by Jakub Šturc on Stack Overflow See other posts from Stack Overflow or by Jakub Šturc
Published on 2010-04-06T14:53:51Z Indexed on 2010/04/06 15:03 UTC
Read the original article Hit count: 365

Filed under:
|
|

At MSDN page for Stopwatch class I discovered link to interesting article which makes following statement about Stopwatch:

However there are some serious issues:

  • This can be unreliable on a PC with multiple processors. Due to a bug in
    the BIOS, Start() and Stop() must be executed on the same processor to get a correct result.

  • This is unreliable on processors that do not have a constant clock speed (most processors can reduce the clock speed to conserve energy). This is explained in detail here.

I am little confused. I've seen tons of examples of using Stopwatch and nobody mention this drawbacks. How serious is this? Should I avoid using Stopwatch?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about stopwatch