C# 指定方法的执行时间,超出时限后,抛出异常
```
Thread thdToKill = null;
Action invokemethod = new Action(() =>
{
thdToKill = Thread.CurrentThread;
});
IAsyncResult ar = invokemethod.BeginInvoke(null, null);
if (!ar.AsyncWaitHandle.WaitOne(apply.TaskExpirationTime))
{
thdToKill.Abort();
}
invokemethod.EndInvoke(ar);
```