annotate MetroWpf/Stocks.Common/Core/TimedDelegates.cs @ 96:188f8b366e87

Unit test project correctly setup as normal class library DLL.
author stevenhollidge <stevenhollidge@hotmail.com>
date Sat, 05 May 2012 13:29:56 +0100
parents 6109bc268b90
children
rev   line source
20
adminsh@apollo
parents:
diff changeset
1 using System;
adminsh@apollo
parents:
diff changeset
2 using System.Diagnostics;
adminsh@apollo
parents:
diff changeset
3
adminsh@apollo
parents:
diff changeset
4 namespace Stocks.Common.Core
adminsh@apollo
parents:
diff changeset
5 {
adminsh@apollo
parents:
diff changeset
6 public class TimedDelegates
adminsh@apollo
parents:
diff changeset
7 {
adminsh@apollo
parents:
diff changeset
8 public static T Execute<T>(
adminsh@apollo
parents:
diff changeset
9 Func<T, T> func,
adminsh@apollo
parents:
diff changeset
10 T paramIn,
adminsh@apollo
parents:
diff changeset
11 out Stopwatch stopwatch)
adminsh@apollo
parents:
diff changeset
12 {
adminsh@apollo
parents:
diff changeset
13 stopwatch = new Stopwatch();
adminsh@apollo
parents:
diff changeset
14 stopwatch.Start();
adminsh@apollo
parents:
diff changeset
15 T result = func(paramIn);
adminsh@apollo
parents:
diff changeset
16 stopwatch.Stop();
adminsh@apollo
parents:
diff changeset
17 return result;
adminsh@apollo
parents:
diff changeset
18 }
adminsh@apollo
parents:
diff changeset
19 }
adminsh@apollo
parents:
diff changeset
20 }