Stopwatch Methods |
The Stopwatch type exposes the following members.
Name | Description | |
---|---|---|
ElapsedTime |
Returns the elapsed CPU time (in seconds) since the stopwatch was created. | |
MainTest |
Demo test the Stopwatch data type.
Takes a command-line argument n and computes the
sum of the square roots of the first n positive integers,
first using Math.Sqrt(), then using Math.Pow().
It prints to standard output the sum and the amount of time to
compute the sum. Note that the discrete sum can be approximated by
an integral - the sum should be approximately 2/3 power (n^(3/2) - 1). |