Week 3 - Tensorflow takes more time than scratch implementation

On the last asignment of the course we built a model using the framework Tensorflow. Along the lessons it has been said that using a framework will speed up the training process. However, when I execute and train the Tensorflow model it has taken it 5min 22secs to run over the 200 epochs, while when we were using the models from scratch it took them far less with a higher number of iterations.

Is this normal or may I have done an implementation error?

Any idea what could be happening?