constructor(){
        this.mode = 0;

        var container = this.container = document.createElement( 'div' );
        container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
        container.addEventListener( 'click', function ( event ) {

            event.preventDefault();
            showPanel( ++ mode % container.children.length );

        }, false );


		this.dom = container;

        this.started = false;

        this.fpsPanel = this.addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );
        this.msPanel = this.addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );
        this.mspsPanel = this.addPanel( new Stats.Panel( 'MSPS', '#0f0', '#020' ) );

        if ( window.performance && window.performance.memory ) {

            this.memPanel = this.addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );

        }

        this.showPanel( 0 );
    }
based on https://github.com/mrdoob/stats.js/ by @author mrdoob / http://mrdoob.com/