I have early heart beats. Can this be the cause of my heart suddenly racing for about 3 seconds then resets itself back to normal?

Yes--PAC's/PVC's. Premature atrial or ventricular beats can trigger runs of svt or non sustained vt. After such a run, there can be a sensation of heart racing followed by a pause and a resetting of the rhythm.