Welcome to HCM.
Thanks for your query.
Going to toilet one or two times after sex and masturbation
is normal. But every 10 minutes for couple hours is not seem to be normal. Get checked your urine and semen for culture and sensitivity. If any infection found in your reproductive tract correct the same. Otherwise it may be an obsession for you and you have to overcome the same. You will be alright soon and nothing serious to worry.