lundi 29 février 2016

In Java, Does adding an else statement (after an already used if) take longer to execute?

Since an if statement is already evaluated anyway, does adding an else statement have any effect on performance?

A practical example:

if(updateTime >= updateIncrement)
{
    update();
    updateTime = 0;
}
else
    updateTime+=deltaTime;

vs:

if(updateTime >= updateIncrement)
{
    update();
    updateTime = -deltaTime;
}
updateTime+=deltaTime;

Aucun commentaire:

Enregistrer un commentaire