annotate Stocks/Stocks.Common/Core/TimedDelegates.cs @ 121:8f94475d3146 tip

final code
author stevenh7776
date Thu, 31 May 2012 15:35:26 +0100
parents 57f20ba55884
children
rev   line source
4
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
1 using System;
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
2 using System.Diagnostics;
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
3
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
4 namespace Stocks.Common.Core
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
5 {
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
6 public class TimedDelegates
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
7 {
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
8 public static T Execute<T>(
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
9 Func<T, T> func,
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
10 T paramIn,
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
11 out Stopwatch stopwatch)
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
12 {
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
13 stopwatch = new Stopwatch();
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
14 stopwatch.Start();
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
15 T result = func(paramIn);
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
16 stopwatch.Stop();
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
17 return result;
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
18 }
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
19 }
57f20ba55884 Fix for webClientShim to use downloadString instead of downloadData
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
20 }