In a medium saucepan combine the onion, brown sugar, vinegar, dried thyme, if using, and garlic. Bring to boiling over medium heat; reduce heat. Simmer, uncovered, about 45 minutes until onions are tender and liquid is nearly evaporated. (Mixture will thicken more as it cools.) Stir in fresh thyme, if using; remove from heat and allow to cool. Use immediately or store, tightly covered, in refrigerator up to 2 weeks. Makes about 1-1/2 cups (thirty-six 2-teaspoon servings).
Serve red onion marmalade with white cheddar shortbread sandwiches.