Play animation from frame to frame

How I can programmatically play animation from frame to frame (or from time to time) ?

you can set animation time using animation[“animName”].time = myTime;