Preheat your oven to 375°F (190°C).
Prepare the root vegetables by peeling and slicing them thinly (about 1/8 inch thick).
Finely chop the onion and garlic.
In a skillet over medium heat, sauté the onion and garlic until softened, about 5 minutes.
In a large mixing bowl, combine the heavy cream, salt, pepper, and thyme (if using).
Layer half of the sliced root vegetables in a greased baking dish, then pour half of the cream mixture over them, followed by half of the cheese. Repeat with the remaining vegetables, cream, and cheese.
Cover the baking dish with aluminum foil and bake for 30 minutes.
Remove the foil and bake for an additional 20-25 minutes, until the top is golden brown and bubbly.
Allow the gratin to rest for 10 minutes before serving.