I'm assuming that you want to know how many hours until they are the same temperature. Here is the equation you can use to figure it out:
40 + 5h= 340-45h
Here is how I would solve it:
40+ 5h= 340 - 45h
+45 h + 45 h
40+50h= 340
-40 -40
50h= 300
/50 /50
h= 6
It will take 6 hours for the two appliances to reach the same temperature, assuming the power doesn't go out. For reference, they would be at 80 degrees.