nerdexam
Microsoft

70-516 · Question #92

You use Microsoft .NET Framework 4.0 to develop an application that connects to a local Microsoft SQL Server 2008 database. The application can access a high-resolution timer. You need to display…

The correct answer is D. Stopwatch sw = new Stopwatch(). See the full explanation below for the reasoning.

Question

You use Microsoft .NET Framework 4.0 to develop an application that connects to a local Microsoft SQL Server 2008 database. The application can access a high-resolution timer. You need to display the elapsed time, in sub-milliseconds (<1 millisecond), that a database query takes to execute. Which code segment should you use?

Options

  • Aint Start = Environment.TickCount;
  • BStopwatch sw = Stopwatch.StartNew();
  • CDateTime Start = DateTime.UtcNow;
  • DStopwatch sw = new Stopwatch();

How the community answered

(42 responses)
  • A
    5% (2)
  • B
    5% (2)
  • C
    12% (5)
  • D
    79% (33)

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice