I have regular bouts of sloth and topor - while at other times my mind is very restless and wants to do stuff (any stuff, so to speak
). What seems to help is distinguishing if it is from some bodily or mental deprivations that can be remedied (as suggested here already, by taking a nap etc.) or whether walking or counting might help to maintain focus.
I am following Ajahn Brahm's advise to show metta to both body and mind when it is feeling dull and not to "battle" it. Usually sometime later, the mind is feeling fresher or it is severe tiredness, then it improves after a good night sleep.
Perhaps this helps