This is likely nystagamus. Nystagamus is an "involuntary eye movement. It is characterized by alternating smooth pursuit in one direction and saccadic movement in the other direction" From an article on Wikipedia
It can occur for several reasons. Including metabolic imbalance, vestibular disturbance (inner ear problems - including inflammation from infection or allergy), medications, tumor, stroke, thiamine deficiency, multiple schlerosis.
I will be glad to help you determine if there is a likely cause:
Are you currently taking any medications?
Do you have any dizziness with this?
But, this is likely very uncomfortable. I suggest you see your doctor or go to an urgent care clinic for evaluation, even if you write back with further information, it will be important for you to do this today to make sure there is no other issue going on that needs to be addressed such as sodium imbalance, high blood pressure, etc.
For future reference, more information on nystagamus is found here:
Please do respond if you have questions or comments currently, I'll be happy to address them.
Well, then in a way that is a good thing, as you likely have an inner ear infection affecting the vestibular system which normally functions to help keep balance. The resulting vertigo causes the nystagamus.
There is a medication called antivert, or Meclizine that can be prescribed that will usually stop this sensation.
You will want to see your doctor or go to an Urgent Care clinic. The doctor will look into your ear and decide if this looks viral or bacterial and if bacterial provide an antibiotic. In the meantime, continuing to get plenty of rest, adequate fluids, good nutrition including fruits if tolerated or vitamin C with Zinc may help.
Let me know if you have any other questions.