Help with creating functions

Hi everyone-
So i'm testing out a basic robot platform, and I have functions for the different actions (forward, backwards, turn left, turn right, etc). What I'm hoping to do is call up the functions with more input for them. For example:

void loop()
{
forward();
}

That calls up the forward function. What I'd like to do is enter something like the following:

void loop()
{
forward(30,5);
}

Where forward would fire at 30% speed for 5 seconds. My current forward() code is below. Any help would be appreciated, or a point in the right direction. New to all of this, so trying to get my feet wet. Thanks everyone!

void forward()
{
      leftServo.write(0);
      rightServo.write(180);
      Serial.println("Full Ahead");
}

Where forward would fire at 30% speed for 5 seconds.

You haven't shown how you control speed. (the five seconds is simple)

Well I'd throw in a quick equation, like 90+(90*.3) for 30 percent, and so on, using variables. Something like below (havent gotten to that point yet).

{
writeSpeed = 90 + 90*speedModifier;
leftServo.write(writeSpeed);
}

The function needs to be declared as taking arguments. The type and name of each argument needs to be defined. For forward() to take 2 arguments:

void forward(int speed, int duration)
{
   unsigned long startTime = millis();
   leftServo.write(speed);
   rightServo.write(speed);
   Serial.println("Full Ahead");
   while(millis() - startTime > (duration * 1000))
   { // Do nothing }
}

Many thanks, thats perfect, I didn't think it was going to be so easy. So I should be able to throw the time into "a for..." loop to control the time of running, and the speed into the servo.Write as you did. I really appreciate it, and once I figure out where all this is going, I'll post my results (basically working on a hex walker with wheels, to operate either walking or rolling). Thanks again!