Turn the heat down to medium-low and add the onions or shallots. Cook for about 10 minutes, turning occasionally, until they are beginning to caramelise, then add the mushrooms and the sliced garlic and cook for a further 4 minutes, then lift out of the pan and set aside (but not with the meat).