Heat butter in a medium, heavy-bottomed saucepan over medium-high heat. Add onions and cook for several minutes, stirring occasionally, until the edges begin to turn slightly brown.
Add mushrooms, cover with a lid and cook for three to four minutes, stirring now and then, until the mushrooms are turning golden brown and have given up some of their juices.
Remove lid, sprinkle with 1/2 teaspoon (or to taste) of salt and a few grinds of pepper and cook for a minute or two longer, until the juices have started to evaporate and concentrate. Remove from heat and serve.
Note: if at any time it looks as if the onions and/or mushrooms are in danger of burning, feel free to add a tablespoon or two of water to the pan.