Answer
It would take Barry 120 minutes and Mike 60 minutes.
Work Step by Step
Barry can complete 1/2x job per minute, and Mike can complete 1/x job per minute. Thus:
$ 40 = \frac{1}{x} +\frac{1}{2x} \\ 40 = \frac{2}{3x} \\ x = 60 $
Thus, it will take Mike 60 minutes and Barry twice that, or 120 minutes.