Your pastry shell should be just cooked but still pale in colour.
Melt the 4 tbsp butter in a heavy based pan and cook the 3 cup onions gently until they are just cooked and golden brown in colour.
Stir in the 2 tsp thyme leaves and leave to cool.
Whisk the 3 eggs lightly then whisk in the 1 cup double cream.
Add the ½ cup Gruyère cheese, 1 pinch nutmeg, and the salt and pepper to taste (begin with ½ teaspoon of each).
Fill the pastry shell with the onions.
Pour the egg and cream mixture over the onions.
Bake for about 30-45 minutes or until golden brown and the egg mixture has puffed up. Smells and tastes yummy!
Notes
To test the classic onion tart recipe, slip a knife blade into the center, and when it comes out almost clean, it is cooked. (It will continue to cook for a few minutes after removing from the oven.)