mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
23 lines
690 B
C#
23 lines
690 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Wabbajack.Common
|
|
{
|
|
public static class ProcessExt
|
|
{
|
|
public static void WaitForExitAndWarn(this Process process, TimeSpan warningTimeout, string processTitle)
|
|
{
|
|
if (!process.WaitForExit((int)warningTimeout.TotalMilliseconds))
|
|
{
|
|
Utils.Status($"{processTitle} - Taking a long time to exit.", alsoLog: true);
|
|
process.WaitForExit();
|
|
Utils.Status($"{processTitle} - Exited after a long period.", alsoLog: true);
|
|
}
|
|
}
|
|
}
|
|
}
|