Your doctor suspects some hormonal
disturbance which is the reason she has prescribed the contraceptive
pill. contraceptive pills are just small doses of hormones. After a few months of treatment with these pills your problem with your periods may reduce. Did your doctor get your Blood hormones tested?
I would advise you to get your LH,FSH, for ovarian hormones,TSH, FT3, FT4 for thyroid
hormones, Blood glucose
(fasting and post lunch) tested if not already done.
The contraceptive pill will help if there is no other reason for you periods being so irregular.