Whilst the test itself will only take 45 minutes the entire process will take longer. You will be advised to arrive before the test time by your test centre when you make your booking. As you will have to be registered before the test and also collect your results after the test it can take longer 45 minutes. If the centre is particularly busy then it make take a couple of hours.
You should ensure that you leave enough time in your day to complete the entire process. If you finish the test quickly then it may be the case that you are finished within 30 minutes - you should not assume this will happen though.