Preheat oven to 350F (180C). Peel the potatoes, rinse and pat dry with paper towel. Using a mandoline or a food processor cut the potatoes in 1/8 inch (3mm) slices.
Cut the onion in thin rings or slices and cut the unpeeled garlic. Rub a 9 inch (23cm) skillet or casserole dish with the cut garlic and grease the bottom and sides with butter.
In a bowl whisk together cream with nutmeg, black pepper and salt.
Spread 1/3 of the sliced potatoes on the prepared skillet. Add about 1/3 of the onion rings, 1/3 cup cheese, fresh thyme and 1/3 cream mixture.
Spread another 1/3 of the sliced potatoes , 1/3 of the onion rings, 1/3 cup cheese, fresh thyme and 1/3 cream mixture.
Finish with the last 1/3 sliced potatoes, remaining cream mixture and spread the remaining 1/3 cup cheese.
Bake for about 60-70 minutes, until potatoes are cooked through and the top is golden.
Let the gratin rest for 10 minutes before serving.