Pre-term contractions

I will be 35 weeks tomorrow and today I went to my routine OB appt. The fetal monitor that measures they baby’s heartbeat & contractions showed I was having mild contractions. My doctor prescribed Nifedipine every 8 hours which I will take at bedtime tonight and she wants to see me tomorrow afternoon to monitor me again. Has this ever happened to anyone & did the medicine work to hold you out to term labor?