there is a difference between ++i and i++ but for int there will be absolutely no detectable speed difference in your example. In this case the compiler will probably even detect that the two loops are identical and compile to the same code.
So what is the difference? ++i says 'increment i and give me the new value' while i++ says 'increment i but give me the value before incrementing.' It becomes more clear in code:
int pre( int i ) { // ++i i += 1; return i;}int post( int i ) { // i++ int tmp = i; i += 1; return tmp;}
However this difference is only important if A) you actually assign the value of the expression to something (e.i. int j = ++i;) or B) the object you increment are very costly to copy.
Back in the olden days of assembly and C, when compilers weren't so smart, programmers where more concerned by never wasting any cycles. Therefore older programmers will often use the ++i form out of habit. But nowadays it's a mostly obsolete micro-optimization when dealing with trivial types.