我有4个函数,每秒都会随机执行。我希望每次重复都加快这个时间,例如第二次执行将在0.95秒内,第三次执行将在0.9中,因此这是我的代码,我的目标是减少每次重复执行的时间-0.01秒:
-(void) Game
{
int rand = (int)arc4random() % 4;
switch (rand) {
case 0:
[self appearred];
break;
case 1:
[self appearblue];
break;
case 2:
[self appearyellow];
break;
case 3:
[self appeargreen];
break;
}
[self performSelector:@selector(Game) withObject:nil afterDelay:1.0];
}