Skip to content

Commit 2589fac

Browse files
committed
Remove useless function
1 parent 8cc9f2d commit 2589fac

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

Flow.Launcher.Infrastructure/Stopwatch.cs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Threading.Tasks;
43
using Flow.Launcher.Infrastructure.Logger;
54

65
namespace Flow.Launcher.Infrastructure
76
{
87
public static class Stopwatch
98
{
10-
private static readonly Dictionary<string, long> Count = new Dictionary<string, long>();
11-
private static readonly object Locker = new object();
129
/// <summary>
1310
/// This stopwatch will appear only in Debug mode
1411
/// </summary>
@@ -62,36 +59,5 @@ public static async Task<long> NormalAsync(string message, Func<Task> action)
6259
Log.Info(info);
6360
return milliseconds;
6461
}
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-
}
9662
}
9763
}

0 commit comments

Comments
 (0)