Remember that the power P is the energy E per unit of time t:

from which

Let's find the energy used by the two devices and then let's compare them.
- refrigerator:
the total time the refrigerator was on is

Its power is 90 W, therefore the energy used is

- hair dryer:
the total time the hair dryer was on is

its power is 900 W, so the energy used is

So, comparing the two energies, we can say that the refrigerator has used more energy than the hair dryer.