Use states.
Define that object could be in one of the N states, and each render frame re-calculate the time elapsed since the moment it switched into that state.

Now the animation comes down to RenderIt(<state number>, <state phase>).

If your object, for example, is imp, and the state number corresponds him chasing the player, then this procedure takes an imp model, looks for the walking animation frames, then calculates, according to phase, the two specific frames and their blend factor, blends them, and finally renders the imp.

If you animate a simple 2d sprite, you need only to calculate the frame number out of the phase, and then draw it.

Thus you had the work split to two simple jobs: calculating the phase according the time passed and calculating the frame you need according that phase. Note, that animation frames not necessarily should be distributed even along the phase axis.

For cyclic animation just substract the top limit out of the phase if it goes over it.