#stats #version #monitor #frame #performance #fps

yanked stats-rs

Stats is a webassembly version written in Rust

0.1.0 Jul 19, 2019

#29 in #fps

MIT license

74KB
258 lines

Webassembly Performance Monitor

Stats is a webassembly version of stats.js written in Rust.

This crate provides a simple info box that will help you monitor your code performance, and can be used either Javascript code or in Rust code.

  • FPS Frames rendered in the last second. The higher the number the better.
  • MS Milliseconds needed to render a frame. The lower the number the better.

Examples

In Javascript

const wasm = import('./pkg/stats_rs');

wasm.then(Stats => {
  const stats = Stats.init();
  stats.attach(document.body);

  function render() {
    stats.update();
    requestAnimationFrame(render);
  }

  render();
});

Rust

// TODO

lib.rs:

Webassembly Performance Monitor

Stats is a webassembly version of stats.js written in Rust.

This crate provides a simple info box that will help you monitor your code performance, and can be used either Javascript code or in Rust code.

  • FPS Frames rendered in the last second. The higher the number the better.
  • MS Milliseconds needed to render a frame. The lower the number the better.

Examples

In Javascript

const wasm = import('./pkg/stats_rs');

wasm.then(Stats => {
  const stats = Stats.init();
  stats.attach(document.body);

  function render() {
    stats.update();
    requestAnimationFrame(render);
  }

  render();
});

Rust

// TODO

Dependencies

~7–9.5MB
~175K SLoC