How can I make smooth rotation of cube?

I have the following code that does the cube rotation around position of child element. Child element is at bottom edge of the cube. This rotation takes place only when user presse right arrow key.

void update(){
  if (Input.GetKeyDown(KeyCode.RightArrow)){
    gameObject.transform.RotateAround(child.transform.position,Vector3.forward, -90);

Replace GetKeyDown with GetKey

Replace -90 with -90 * Time.Dt

This will make your code frame rate independant.