You need to get yourself checked what you are having is intermittent tachycardia / arrhythmia which means that intermittently your heart rate increases or the heart Rhythm changes which can be dangerous if it does not get corrected on its own. Or it can be an early sign of impending heart disease.
but to diagnose it you need to get an ECG done while you are having the rhythm problem or you can get holter monitoring for 24 hours during which if you have this episode it will get registered and documented. Also you need to get a complete
lipid profile done as well as a echocardiogram and blood
sugar levels to look for risk factors. Once you have done that you need to Consult a cardiologist with the reports