vendredi 19 juin 2015

Checking perfomance between if(false){}else{if(false){}} and if(false){}else if(false){}

Please help checking performance between two block code bellow. I can't I think both is the same when run-time(overlook figure element and the same condition).

// Block I
    if(condition1)
    {
       // Do something
    }
    else
    {    if(condition2)
        {
           // Do something
        }
        else
        {    if(condition3)
            {
               // Do something
            }
            else
            {    if(condition4)
                {
                   // Do something
                }
            }
        }
    }

    //--------------------------------
    // Block II
    if(condition1)
    {
       // Do something
    }
    else  if(condition2)
    {
       // Do something
    }
    else  if(condition3)
    {
       // Do something
    }
    else  if(condition4)
    {
       // Do something
    }

Help me!

Aucun commentaire:

Enregistrer un commentaire