Unfortunately, since its not a supported feature, I can only point you to the function that you would be using, but you would have to implement this yourself. the function is called getDistance and it is called on a GDirections object:
reference.html#GDirections.getDistance