codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
static Tuple<TimeSpan, long> PerfTest(Action<long /*iterations*/> unitUnderTest) { long n = 100; var sw = new StopWatch(); unitUnderTest(10); // preheat for(;;) { sw.Start(); unitUnderTest(n); sw.Stop(); if (sw.Elapsed.TotalSeconds < 1.0) { n *= 2; continue; } return Tuple.Create(sw.Elapsed, n); } }
Private
[
?
]
Run code
Submit