摘要: 要控制执行时间,我们必须使用异步模式,在另外一个线程中执行方法,如果超时,则抛出异常终止线程执行。 如下实现的方法: class Program { static void Main(string[] args) { //try the five second method with a 6 sec 阅读全文
posted @ 2020-02-13 14:51 欣欣点灯 阅读(848) 评论(0) 推荐(0) 编辑