Thanks for the code.
In the cells, which use datetime to profile the code, you are still starting the timer before the first epoch and stopping after all epochs were done.
The output also shows this:
Epoch: 100 	Training loss:0.020610
Duration: 0:07:08.332585

As you can see, 100 epochs were performed before the timer was stopped.
If you want to profile a single backward call, you would need to stick to the posted code, i.e. start the timer before the backward pass, perform the backward pass, and stop the timer.
If you are working with a GPU, you should additionally synchronize the code before starting and stopping the timer via torch.cuda.synchronize().