netcore 间隔时长修改参数 示例


using System;
using System.Threading.Tasks;

class Program
{
private static int yourParameter = 0;

static async Task Main()
{
while (true)
{
// 等待5分钟
await Task.Delay(TimeSpan.FromMinutes(5));

// 在这里更新你的参数的值
yourParameter++;

// 打印当前参数的值
Console.WriteLine($"Updated parameter value: {yourParameter}");
}
}
}

posted @ 2023-11-18 11:17  爱吃糖的宝宝  阅读(36)  评论(0)    收藏  举报