I don’t know if there’s an ideal time but you should be able to do one at the end of your base period to judge your endurance progress. You won’t be particularly fast but you should feel strong. Another closer to your IM to judge your progress again and to work out any bugs you might have with your race. IE, transition, nutrition, etc.
And here’s where the group may differ… I believe these races should be done at race pace and not as a training day.