Files
HTCloud/HT.Cloud.Code/Util/AsyncTaskHelper.cs
2023-03-03 16:07:50 +08:00

28 lines
461 B
C#

using System;
using System.Threading.Tasks;
namespace HT.Cloud.Code
{
public class AsyncTaskHelper
{
/// <summary>
/// 开始异步任务
/// </summary>
/// <param name="action"></param>
public static void StartTask(Action action)
{
try
{
Action newAction = () =>
{ };
newAction += action;
Task task = new Task(newAction);
task.Start();
}
catch (Exception ex)
{
LogHelper.WriteWithTime(ex);
}
}
}
}