Home > Net >  After a certain period of time out of the for loop
After a certain period of time out of the for loop

Time:01-03

For loop of calling a function myfunction, for one cycle, this function takes a very long, so I think more than jump out of the current cycle into the next cycle after a certain time,

Because the program running within myfunction, so can't added in the for loop if judgment is greater than a certain time, another idea is to use the Timer, to a specified time after the jump out to, but I try to also not line,

Which ace to give directions there is no other good method, thank you very much!

 for (I=1; iMyfunction;//one cycle takes over a certain period of time is out of this function 
}

CodePudding user response:

Encapsulates a task, start to perform start the timer, the time is cancelled

CodePudding user response:

reference 1/f, kill matt, bull response:
encapsulate a task, start the timer starts, to cancel time
start a timer in myfunction, timeout jumped out? How to jump out of the function myfunction? I tried this method return and so on are not,
  •  Tags:  
  • C#
  • Related