How would the period of spring mass system change, when it is made to oscillate horizontally and then vertically?

The time period remains same in both the cases