Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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);


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: