using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ThreadTimerExam
{
class Program
{
static void Main(string[] args)
{
var timer = new System.Threading.Timer(TimerAction, null, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(3));
Thread.Sleep(15000);
timer.Dispose();
Console.Read();
}
static void TimerAction(object obj)
{
Console.WriteLine("System.Threading.Timer {0:T}", DateTime.Now);
}
}
}
相关文章
- GS使用HTTPS登录的设置过程
- 使用kindeditor获取不到富文本框中的值
- js中setTimeout和clearTimeout的使用
- 使用vue的mixins混入实现对正在编辑的页面离开时提示
- 0045 Spring中使用DataSourceTransactionManager进行事务管理的xml配置
- Spring中使用DataSourceTransactionManager进行事务管理的xml配置
- spring boot 使用 mybatis 开启事务回滚 的总结
- transient关键字的使用
- 如何使用 TP中的公共函数 (定义在common/common.php中的函数)
- VisualSVN Server的配置和使用方法