Hacker News new | ask | show | jobs
by olalonde 5673 days ago
I was a bit curious what exactly this "system load" was. Turns out it's a ratio between the time the browser takes to draw the particles and the frequency at which it is supposed which to draw.

    this.tick_duration = 25;
    
    ....

    this.now = new Date().getTime();

    // Drawing...

    this.time_to_paint = (new Date().getTime()) - this.now;
    this.load = Math.round((this.time_to_paint / this.tick_duration) * 100);
1 comments

This should shed some light on the technique: http://gamedev.stackexchange.com/questions/1589/fixed-time-s...