Get UI Button dimensions in game via script C#

Hi, I tried to find how to get dimensions of UI button but I cannot find how. We can check rect information but they are saying dimensions from unity editor not from game (devices have got different resolution so they are differrent).

Coce i used to get it is:
print ("rect = " + movementJoyStick.GetComponent>RectTransform>().rect);
At the moment I’m using some math to finally get them but I’m there must be simple way to get those information.
When I’m testing them in editor they are 370 but from print function they are always 500 in Update function.

Try multiplying the width/height by the ScaleFactor of your Canvas to get the adjusted size