Solved by ptrblck in post #2 
              
              
                If you are using a GPU, you would have to synchronize the code before starting and stopping the timer via torch.cuda.synchronize() as the timings would be wrong otherwise.