示例#1
0
 private IEnumerable <ICorutine> crPrint(int n)
 {
     for (int i = 0; i < n; ++i)
     {
         Console.WriteLine(i);
         yield return(Corutine.Call(crSleep(1000)));
     }
 }
示例#2
0
        private IEnumerable <ICorutine> crRun()
        {
            yield return(Corutine.Call(
                             crPrint(5)
                             ));

            yield return(Corutine.Call(
                             crPrint(5),
                             crPrint(3),
                             crPrint(4)
                             ));

            yield return(Corutine.Call(
                             crPrint(3)
                             ));
        }