Refactor: split Global.cs

This commit is contained in:
ChsBuffer
2021-03-25 12:21:42 +08:00
parent 5da5daa112
commit dcb90ccdcd
15 changed files with 45 additions and 82 deletions

View File

@@ -1,27 +0,0 @@
using System;
using System.Diagnostics;
namespace Netch.Models
{
public class LogStopwatch
{
public LogStopwatch(string message)
{
_stopwatch = Stopwatch.StartNew();
Console.WriteLine($"Start {message} LogStopwatch");
}
private readonly Stopwatch _stopwatch;
public void Log(string name,bool stop = false)
{
if (!_stopwatch.IsRunning)
throw new Exception();
_stopwatch.Stop();
Console.WriteLine($"{name} LogStopwatch: {_stopwatch.ElapsedMilliseconds}");
if(!stop)
_stopwatch.Start();
}
}
}

View File

@@ -161,7 +161,7 @@ namespace Netch.Models
/// <returns>模式文件字符串</returns>
public string ToFileString()
{
return $"# {Remark}, {Type}, {(BypassChina ? 1 : 0)}{Global.EOF}{string.Join(Global.EOF, Rule)}";
return $"# {Remark}, {Type}, {(BypassChina ? 1 : 0)}{Constants.EOF}{string.Join(Constants.EOF, Rule)}";
}
}