mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Better name
Timeit.Stopwatch -> Stopwatch.Normal Timeit.StopwatchDebug -> Stopwatch.Debug
This commit is contained in:
@@ -4,15 +4,15 @@ using Wox.Infrastructure.Logger;
|
||||
|
||||
namespace Wox.Infrastructure
|
||||
{
|
||||
public static class Timeit
|
||||
public static class Stopwatch
|
||||
{
|
||||
/// <summary>
|
||||
/// This stopwatch will appear only in Debug mode
|
||||
/// </summary>
|
||||
public static void StopwatchDebug(string name, Action action)
|
||||
public static void Debug(string name, Action action)
|
||||
{
|
||||
#if DEBUG
|
||||
Stopwatch(name, action);
|
||||
Normal(name, action);
|
||||
#else
|
||||
action();
|
||||
#endif
|
||||
@@ -22,16 +22,16 @@ namespace Wox.Infrastructure
|
||||
private static void WriteTimeInfo(string name, long milliseconds)
|
||||
{
|
||||
string info = $"{name} : {milliseconds}ms";
|
||||
Debug.WriteLine(info);
|
||||
System.Diagnostics.Debug.WriteLine(info);
|
||||
Log.Info(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This stopwatch will also appear only in Debug mode
|
||||
/// </summary>
|
||||
public static long Stopwatch(string name, Action action)
|
||||
public static long Normal(string name, Action action)
|
||||
{
|
||||
var stopWatch = new Stopwatch();
|
||||
var stopWatch = new System.Diagnostics.Stopwatch();
|
||||
stopWatch.Start();
|
||||
action();
|
||||
stopWatch.Stop();
|
||||
@@ -53,11 +53,11 @@
|
||||
<Compile Include="Hotkey\KeyEvent.cs" />
|
||||
<Compile Include="Logger\Log.cs" />
|
||||
<Compile Include="PeHeaderReader.cs" />
|
||||
<Compile Include="Stopwatch.cs" />
|
||||
<Compile Include="Storage\BinaryStorage.cs" />
|
||||
<Compile Include="Storage\IStorage.cs" />
|
||||
<Compile Include="Storage\JsonStorage.cs" />
|
||||
<Compile Include="StringMatcher.cs" />
|
||||
<Compile Include="Timeit.cs" />
|
||||
<Compile Include="Unidecoder.Characters.cs" />
|
||||
<Compile Include="Http\HttpRequest.cs" />
|
||||
<Compile Include="Storage\BaseStorage.cs" />
|
||||
|
||||
Reference in New Issue
Block a user