How to get the servo motor to move slower when ardunio is first started up

Hello I have a problem. This happens all the time when I'm working on a project with servo motors when I first turn on the ardunio board the servo motor goes as fast as it can to the degree at which it is told to do. I was wondering if their is a way to make it run slower to that position when I start it up? I have my servo controlling a gear and it has a lot of weight on it so when it does it really fast it's skipping gears and shifting the whole object in bad ways. So my question is can I slow the rate at witch the servo goes slower at start up to find its position. Thanks for you help

Try the method used in the servo sweep sketch, where in the "for" it moves only one degree at a time.

This is the code I'm useing. It's not during the code that is the problem it's when the code first starts up. It goes to one of the 180 degree position as fast as the servo motor can and it is stripping the gears

Presumably you don't know where it stopped then?

The servo.attach() will send a pulse to 90 degrees (1500ms) by default. You can change that by doing a servo.write() before the attach(), then it will go where you want. But I don't think you can slow that, so if you don't know where it is at startup there's not much you can do.

If you know where it stops- perhaps "home" it on an orderly shutdown?- then you could send it to that position (ie and not move it at all) with the write() before the attach().