Created
July 1, 2014 16:30
-
-
Save FoC-/629965f5dff3d36cd135 to your computer and use it in GitHub Desktop.
Revisions
-
FoC- created this gist
Jul 1, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ private T Mesure<T>(Func<T> func, out TimeSpan time) { var stopwatch = new Stopwatch(); stopwatch.Start(); var result = func(); stopwatch.Stop(); time = stopwatch.Elapsed; return result; } private void Mesure(Action func, out TimeSpan time) { var stopwatch = new Stopwatch(); stopwatch.Start(); func(); stopwatch.Stop(); time = stopwatch.Elapsed; }