mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-24 04:09:29 +01:00
Fixed 10-15% idle CPU load by removing log dequeue loop
This commit is contained in:
@@ -39,20 +39,15 @@ namespace Flowframes
|
||||
public static void Log(string msg, bool hidden = false, bool replaceLastLine = false, string filename = "")
|
||||
{
|
||||
logQueue.Enqueue(new LogEntry(msg, hidden, replaceLastLine, filename));
|
||||
ShowNext();
|
||||
}
|
||||
|
||||
public static async Task Run()
|
||||
public static void ShowNext ()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (!logQueue.IsEmpty)
|
||||
{
|
||||
LogEntry entry;
|
||||
LogEntry entry;
|
||||
|
||||
if (logQueue.TryDequeue(out entry))
|
||||
Show(entry);
|
||||
}
|
||||
}
|
||||
if (logQueue.TryDequeue(out entry))
|
||||
Show(entry);
|
||||
}
|
||||
|
||||
public static void Show(LogEntry entry)
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace Flowframes
|
||||
IOUtils.DeleteContentsOfDir(Paths.GetLogPath()); // Clear out older logs from previous session
|
||||
|
||||
Networks.Init();
|
||||
Task.Run(() => Logger.Run());
|
||||
Task.Run(() => DiskSpaceCheckLoop());
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
|
||||
Reference in New Issue
Block a user