我正在寻找一个简单的异步代码示例(最好在VB中使用.NET)来做这样的事情:
Main()
async Sub1()
async Sub2()
await Sub1()
print "end"
End
Sub1()
for n=1 to 1000
{ do something }
next
End sub
Sub2()
if n=500 in Sub1() then print "Hello"
End sub
另一种选择可能是:
Main()
async Sub1()
async Sub2()
await Sub1()
print "end"
End
Sub1()
for n=1 to 1000
if n=500 send signal
{ do something }
next
End Sub
Sub2()
if signal is received print "Hello"
End Sub