You can create the caramelized onions a day or two in advance if you prefer. They can be stored in the fridge and heated when needed.
If you cook your burgers on a grill, make sure the grill is very hot. Sear each burger patty for at least 3 minutes on both sides, then move burger patties to a cooler area on your grill to allow to cook to your preferred temperature.