File tree Expand file tree Collapse file tree 1 file changed +0
-34
lines changed
Flow.Launcher.Infrastructure Expand file tree Collapse file tree 1 file changed +0
-34
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
- using System . Collections . Generic ;
3
2
using System . Threading . Tasks ;
4
3
using Flow . Launcher . Infrastructure . Logger ;
5
4
6
5
namespace Flow . Launcher . Infrastructure
7
6
{
8
7
public static class Stopwatch
9
8
{
10
- private static readonly Dictionary < string , long > Count = new Dictionary < string , long > ( ) ;
11
- private static readonly object Locker = new object ( ) ;
12
9
/// <summary>
13
10
/// This stopwatch will appear only in Debug mode
14
11
/// </summary>
@@ -62,36 +59,5 @@ public static async Task<long> NormalAsync(string message, Func<Task> action)
62
59
Log . Info ( info ) ;
63
60
return milliseconds ;
64
61
}
65
-
66
-
67
-
68
- public static void StartCount ( string name , Action action )
69
- {
70
- var stopWatch = new System . Diagnostics . Stopwatch ( ) ;
71
- stopWatch . Start ( ) ;
72
- action ( ) ;
73
- stopWatch . Stop ( ) ;
74
- var milliseconds = stopWatch . ElapsedMilliseconds ;
75
- lock ( Locker )
76
- {
77
- if ( Count . ContainsKey ( name ) )
78
- {
79
- Count [ name ] += milliseconds ;
80
- }
81
- else
82
- {
83
- Count [ name ] = 0 ;
84
- }
85
- }
86
- }
87
-
88
- public static void EndCount ( )
89
- {
90
- foreach ( var key in Count . Keys )
91
- {
92
- string info = $ "{ key } already cost { Count [ key ] } ms";
93
- Log . Debug ( info ) ;
94
- }
95
- }
96
62
}
97
63
}
You can’t perform that action at this time.
0 commit comments