Skip to content

Commit

Permalink
minor NmkdStopwatch changes
Browse files Browse the repository at this point in the history
  • Loading branch information
n00mkrad committed Sep 14, 2022
1 parent 433a565 commit 6e40c6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Code/Media/AvProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public static async Task<string> RunFfmpeg(string args, string workingDir, LogMo

if (!show)
{
ffmpeg.OutputDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.sw.Restart(); };
ffmpeg.ErrorDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.sw.Restart(); };
ffmpeg.OutputDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.Sw.Restart(); };
ffmpeg.ErrorDataReceived += (sender, outLine) => { AvOutputHandler.LogOutput(outLine.Data, ref processOutput, "ffmpeg", logMode, progressBar); timeSinceLastOutput.Sw.Restart(); };
}

ffmpeg.Start();
Expand Down
2 changes: 1 addition & 1 deletion Code/MiscUtils/BackgroundTaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void ClearExpired ()
{
foreach(RunningTask task in runningTasks)
{
if(task.timer.sw.ElapsedMilliseconds > task.timeoutSeconds * 1000)
if(task.timer.Sw.ElapsedMilliseconds > task.timeoutSeconds * 1000)
{
Logger.Log($"[BgTaskMgr] Task with ID {task.id} timed out, has been running for {task.timer}!", true);
runningTasks.Remove(task);
Expand Down
10 changes: 5 additions & 5 deletions Code/MiscUtils/NmkdStopwatch.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
using System;
using System.Diagnostics;
using System.Linq;

namespace Flowframes.MiscUtils
{
class NmkdStopwatch
{
public Stopwatch sw = new Stopwatch();
public long ElapsedMs { get { return sw.ElapsedMilliseconds; } }
public Stopwatch Sw = new Stopwatch();
public TimeSpan Elapsed { get { return Sw.Elapsed; } }
public long ElapsedMs { get { return Sw.ElapsedMilliseconds; } }

public NmkdStopwatch(bool startOnCreation = true)
{
if (startOnCreation)
sw.Restart();
Sw.Restart();
}

public override string ToString()
{
return FormatUtils.TimeSw(sw);
return FormatUtils.TimeSw(Sw);
}
}
}

0 comments on commit 6e40c6a

Please sign in to comment.