In a medium saucepan, heat oil over medium-high heat. Add onion and garlic; cook, stirring occasionally, until soft and fragrant, 3 to 5 minutes. Stir in tomatoes, vinegar, sugar, salt, basil, thyme, and pepper; bring to a boil. Reduce heat to medium-low; cook, stirring occasionally, until sauce has reduced to about 1¼ cups (about 303 grams), 10 to 12 minutes. Remove from heat; let cool for 15 minutes.