My mouse won't work on Minecraft?

So, today, I was playing Minecraft and everything was fine. Then I quit for a while, and started again. I started playing and when I looked around, the mouse freaked out and turned at like double the speed while being only 2 FPS. But when I pressed ESC to see if something was wrong, my mouse worked fine. Only while in-game is it doing this. I don't know what's wrong, and I looked it up and I found nothing on it. Does anyone have any answers?

OK, if this happens very rarely, maybe once every hour of playing, then I think it's just a minor problem with your mouse, because my mouse does that too. I'm on laptop when I play, so maybe that affects it? I also have major periods of about 6fps, then after 10 minutes of major lag, minecraft runs at 60fps for about 1 minute. It's weird!