Preheat the oven to 180C / 355F and butter a medium-sized baking dish (12 x 8 inches or similar).
Place the cream, milk, garlic, nutmeg (if using) and thyme in a medium saucepan and heat to a simmer. Add the potato and onion slices, put a lid on the saucepan and simmer for 10 minutes, until the potatoes are just tender. Give them a good stir after half the cooking time.
Remove the thyme sprigs, then empty half of the potato mixture into the baking dish. Grind over plenty of salt and pepper and sprinkle over about a third of the cheese.
Empty the rest of the potato mixture and cream/milk into the dish, smoothing out the top a little, then sprinkle over the rest of the cheese. Grind over a bit more pepper (if you like), then sprinkle over a little more fresh thyme.
Bake for 25 to 30 minutes until golden and bubbling.
