It takes around 20 minutes to fully cook corn on the cob on the grill in the foil.
To give the corn a better flavor before putting the corn on the cob in the foil spread some butter over the corn on the cob and then wrap them in the foil.
It's best to use heavy duty aluminum foil when cooking corn on the cob on the grill.
When grilling the corn on the cob in the foil turn the corn on the cob every few minutes and after 20 minutes the corn on the cob should be ready to eat.
If it's not done enough for you then you might want to grill the corn on the cob again for another few minutes but 20 minutes is usually enough time for the corn on the cob to cook on the grill.