How to calculate x/y speed?

Lets say my object has a max speed of 10.

if it is moving:
x += 5;
y += 0;
Then it’s speed is 5

if it is moving:
x += 0;
y += 10;
Then it’s speed is 10

but if it is moving:
x += 5;
y += 10;
Then it’s speed is ???

How can I calculate this using Mathf? Which function to use?
Thanks

You are looking for the magnitude of the vector (which can be found via Vector2.magnitude).