Skip to content

Conversation

@MartinsYong
Copy link

@MartinsYong MartinsYong commented Jul 29, 2019

Just check this test case:

describe('rAF', () => {
    it('tick', done => {
        let start = new Date().getTime();
        let times = 0;
    
        raf(function tick () {
            if (++times === 10) {
                const interval = (new Date().getTime() - start);
                console.assert(interval >= 9 * 16, `should take at least ${times - 1} frames worth of wall time: ${interval}ms`);
                done();
            } else {
                raf(tick);
            }
        });
    })
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant