The previous answers on this topic are of limited help in that they are somewhat-confused and often contradictory. Look to the meaning of your sentence. If you consider your subject a collective thing that you think of as a unit, then use a singular verb. If you consider your subject a multiple with separate identifies, then use a plural verb:
Twenty miles is the distance to the nearest city.
The twenty act together as a measure, so the verb is singluar.
The last twenty miles were increasingly difficult to travel.
Each mile was more difficult than the last and thus distinguishable from the previous, so the verb is plural.
Three milliliters is the dose the doctor prescribed.
Three milliliters is one amount that makes up a single dose, so the verb is singular.
The doctor prescribed for him one-milliliter doses of medication to be taken three times a day. The first three milliliters were enough to cure him.
The three milliliters came separately, one at a time, so the verb is plural.