Hi Karen,
The effect of metformin lasts for up to 6 hours (12 hours for the slow-release variety). It is normally recommended that you should take them with a meal (that is with some water about halfway through the meal) rather than before or after the meal. This means they get digested alongside the food, which makes them more easily digestible and minimises the side effects they can have. It is estimated that the maximum impact that metformin can have on blood sugar is a reduction of 1.5 mmol/l, and it is claimed that it is not possible for them to cause a hypo, so I wouldn't worry too much about taking them too close together.
As has been said, it may be more effective if you could space them further apart, but I wouldn't worry too much if that's not possible.