Peel and slice the onions thinly.
Heat olive oil and butter in a large skillet over medium heat.
Add the sliced onions and stir to coat.
Sprinkle salt over the onions to help draw out moisture.
Cook the onions, stirring occasionally, for about 10 minutes.
Reduce heat to low and continue cooking for another 20-30 minutes.
Stir in sugar if desired, to enhance sweetness.
Cook until onions are golden brown and caramelized, adjusting heat as necessary.
Remove from heat and let cool slightly.
Garnish with fresh thyme if using.