The second option is better, because you won’t need to add a value each iteration, and you also do not need to create a starting variable. Keep in mind for both tests below, I removed the task.wait().
Time taken for 100000000 iterations using for i, n:
0.2458439999991242
Time taken for 100000000 iterations using while i < n:
0.425913799999762
I would worry about how your game is actually structured though, because these small differences will not affect your game as much as having bad organization or code structuring (like having an individual script for every part).
Even in C (the language I’m assuming you’re using), for loops are faster (arguably more readable too) than while loops. You shouldn’t just tell OP an answer without benchmarking/research.
Could you show your results and code used to test? I tested it and my results show that while loops are around 0.5x the speed of for loops over 100000000 iterations (without the task.wait()). Our times may vary though, because our PCs will be different specs, but the ratio of performance should be similar.
The difference will likely be fractions of a millisecond — almost certainly not enough to make any meaningful difference. Usually, you don’t want to make your code more complex just for minimal performance gains.
From the wording in your post, it doesn’t even sound like you’ve tried either solution to see how it works. So, go back and finish your script, and try the simpler for loop and see if it causes performance issues. Chances are, it will not. If it does, there are probably some larger system design questions to talk about that would be more fruitful than refactoring it into a repeat or while loop.
I agree with @kiloe2. Unless you notice your game is laggy, don’t worry about performance. I would recommend opening up the script performance tab though.