Ideally the long runs are done to the specified distance.  It is very important for a marathon that you have the confidence mentally and the ability physically to complete the event.  You will notice that the bulk of most long runs are at race pace or race effort.  This means you can definitely do the long runs as time based versus distance based.  The math is usually quite easy but if you are struggling here is a Pace Calculator

If the program specifies that you run 20km at race pace and your race pace is 4 minutes/km then you can run the main set as 80 minutes at race pace or race effort.

Posted in: Running