c# 如何在不停止主线程的情况下在 2 个函数调用之间暂停
Foo();
Foo(); // i want this to run after 2 min without stopping main thread
Function Foo()
{
}
谢谢
最佳答案
尝试:
Task.Factory.StartNew(() => { foo(); })
.ContinueWith(t => Thread.Sleep(2 * 60 * 1000))
.ContinueWith(t => { Foo() });
关于c# 如何在不停止主线程的情况下在 2 个函数调用之间暂停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16086734/