The first one runs at 2ms but the second one runs at 3ms. I cannot tell what is the difference between the two functions?

public int titleToNumber2ms(String s) {

int result = 0;

for (int i = 0; i < s.length(); i++){

result *= 26;

result += ((s.charAt(i) - 'A') + 1);

}

return result;

}

```
public int titleToNumber3ms(String s) {
int result = 0;
for (int i = 0; i < s.length(); i++) {
result = result * 26 + (s.charAt(i) - 'A' + 1);
}
return result;
}
```