Heat the oven and prepare the dish. Heat the oven to 375F. Rub a 9x13-inch baking dish or 2-quart baking dish with the butter.
Warm the cream. Combine the cream, milk, garlic, and nutmeg in a saucepan over medium heat and warm for about 5 minutes, until steaming but not boiling. Remove from the heat.
Slice the potatoes. Peel the potatoes and slice them 1/8 inch thick with a knife, mandoline with its guard, or food processor slicing disc. Keep the slices as even as possible.
Build the first layer. Arrange a third of the slices in the dish, overlapping by about half. Sprinkle with a third of the salt, pepper, and thyme, then a third of the Gruyere. Pour over a third of the warm cream mixture.
Repeat the layers. Repeat step 4 twice more, finishing with Gruyere and a few extra thyme leaves on top.
Bake covered. Cover the dish tightly with foil and bake at 375F for 40 minutes, until the potatoes are starting to soften.
Bake uncovered. Remove the foil and bake for 25 to 30 minutes more, until the top is golden and a knife slides through the center layers with almost no resistance.
Rest before serving. Rest for 15 minutes so the cream settles into the layers, then serve warm.