← Back to team overview

nunit-core team mailing list archive

[Bug 1072379] [NEW] Report test execution time at a higher resolution

 

Public bug reported:

Currently, we measure test execution time using DateTime.Now, which
depends on the System Timer. Per the docs, that gives us a resolution of
10ms, although it seems higher in practice, probably due to context
switching time.

Really, if we want a good measure of how long it took to run a test, we
should probably be using the Stopwatch class.

While we are at it, we should probably use a TimeSpan rather than a double to represent elapsed time in the TestResult class,
at least in NUnit 3.0, and possibly in the other projects as well. The NUnit 2.6 XML should continue to report time in seconds, while the NUnit 3.0 XML can use a string representation of the TimeSpan.

** Affects: nunit-3.0
     Importance: High
         Status: Triaged

** Affects: nunitlite
     Importance: High
         Status: Triaged

** Affects: nunitv2
     Importance: High
         Status: Triaged

** Changed in: nunitv2
       Status: New => Triaged

** Changed in: nunitv2
   Importance: Undecided => High

** Also affects: nunitlite
   Importance: Undecided
       Status: New

** Also affects: nunit-3.0
   Importance: Undecided
       Status: New

** Changed in: nunitlite
       Status: New => Triaged

** Changed in: nunitlite
   Importance: Undecided => High

** Changed in: nunit-3.0
       Status: New => Triaged

** Changed in: nunit-3.0
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/1072379

Title:
  Report test execution time at a higher resolution

Status in NUnit Test Framework:
  Triaged
Status in NUnitLite Testing Framework:
  Triaged
Status in NUnit V2 Test Framework:
  Triaged

Bug description:
  Currently, we measure test execution time using DateTime.Now, which
  depends on the System Timer. Per the docs, that gives us a resolution
  of 10ms, although it seems higher in practice, probably due to context
  switching time.

  Really, if we want a good measure of how long it took to run a test,
  we should probably be using the Stopwatch class.

  While we are at it, we should probably use a TimeSpan rather than a double to represent elapsed time in the TestResult class,
  at least in NUnit 3.0, and possibly in the other projects as well. The NUnit 2.6 XML should continue to report time in seconds, while the NUnit 3.0 XML can use a string representation of the TimeSpan.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunit-3.0/+bug/1072379/+subscriptions


Follow ups

References