In a medium saucepan, bring the beef or vegetable broth to a boil. Add the rice, salt, and pepper. Stir briefly, then reduce heat, cover, and simmer for 18-20 minutes or until the rice is cooked and absorbs all the liquid. Remove from heat and let it sit covered for 5 minutes.
Meanwhile, in a large skillet, heat the olive oil and 2 tablespoons of butter over medium heat. Once the butter is melted, add the sliced onions. Sauté the onions for about 15 minutes until they are caramelized and golden brown. Stir occasionally to prevent burning.
Once the rice has rested, fluff it with a fork and add it to the skillet with the caramelized onions. Stir gently to combine.
Add the remaining tablespoon of butter and dried thyme to the rice mixture. Stir until the butter is melted and everything is well incorporated.
Remove the skillet from heat and sprinkle the grated Gruyère cheese over the rice. Cover for a few minutes until the cheese has melted.
Serve warm, garnished with freshly chopped parsley if desired.