Animation create with spriteFrames

How can we repeat the animation more than one time , while it’s created with spriteframes ,

the code is written below :

   var animation = this.getComponent(cc.Animation);
    
    cc.loader.loadRes("test assets/atlas", cc.SpriteAtlas, (err, atlas) => {
        var spriteFrames = atlas.getSpriteFrames();
        
        var clip = cc.AnimationClip.createWithSpriteFrames(spriteFrames, 10);
        clip.name = 'run';
        clip.wrapMode = cc.WrapMode.Loop;



        animation.addClip(clip);
        animation.play('run');
    });

Thanks

hi
you can use Animation State for this purpose , read obtain animation state section in this for more information.