Scheduleonce only executes the time function once, which can be seen as delayed execution. The general idea of using scheduleonce to create a delayed for loop today is as follows: Global inti1; scheduleF (0.5f); call the time function voidhello: scheduleF (floatf) {if (i10 ){...... Scheduleonce (schedule_selector (
Scheduleonce only executes the time function once, which can be seen as delayed execution. The general idea of using scheduleonce to do a delayed for loop today is as follows: // global int I = 1; scheduleF (0.5f); // call // time function void hello :: scheduleF (float f) {if (i10 ){...... Scheduleonce (schedule_selector (
Scheduleonce only executes the time function once, which can be seen as delayed execution.
Today, I want to use scheduleonce for a delayed for loop.
The general idea is as follows:
// Global
Int I = 1;
ScheduleF (0.5f); // call
// Time Functions
Void hello: scheduleF (float f)
{
If (I <10)
{
......
Scheduleonce (schedule_selector (hello: scheduleF), 0.3f );
}
I ++;
}
I tried it. no, I = 2 at most. It should be manually called once. scheduleonce can do it for the first time.
So I think it may be that scheduleonce has already added this function and cannot be added multiple times. So I want to run the un command before adding it, but I didn't find the unscheduleonce method and used unschedule, the test still fails.
Instead, they all changed to schedule and unschedule.
Void hello: scheduleF (float f)
{
If (I <10)
{
......
Unschedule (schedule_selector (hello: scheduleF ));
Schedule (schedule_selector (hello: scheduleF), 0.3f );
}
Else
{
Unschedule (schedule_selector (hello: scheduleF ));
}
I ++;
}
This is enough, but the unscheduleonce method is missing. I wonder if it is a vulnerability ····