JSPM

  • Created
  • Published
  • Downloads 6833
  • Score
    100M100P100Q131722F
  • License MIT

WebGL stats for pixi.js or/and three.js

Package Exports

  • pixi-stats
  • pixi-stats/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pixi-stats) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pixi-stats

npm version npm downloads per week

JavaScript Performance Monitor

This library provides an info box that will help you monitor your code performance.

  • 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.
  • MB MBytes of allocated memory. (Run Chrome with --enable-precise-memory-info)
  • DC Draw Calls made within one frame.
  • TC Texture Count used within one frame.
  • CUSTOM User-defined panel support.

Screenshots

fps.png ms.png mb.png custom.png

pixi.js

Live demo

https://jackie-aniki.github.io/oneforall/demo/?fps

Usage

import { Application } from 'pixi.js';
import { Stats } from 'pixi-stats';

const { renderer } = new Application();
const stats = new Stats(renderer);

Parameters

const element = document.querySelector('#your_container');
const ticker = PIXI.ticker;

new Stats(renderer, ticker, element);

three.js

Live demo

https://legacyofpain.app/?fps

Usage

import { Renderer } from 'three';
import { Stats } from 'pixi-stats';

const renderer = new Renderer();
const stats = new Stats(renderer);

Installation

npm install pixi-stats --save

Set CSS

#stats {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

#stats canvas {
  width: max(100px, 10vw, 10vh);
  height: max(60px, 6vh, 6vw);
  user-select: none;
}

Contributors

The credit goes to:

License

MIT