NativeScript Core

Fps Meter

"fps-meter" module allows to logging frames-per-second statistics for the app.

const fpsMeter = require("tns-core-modules/fps-meter");

Basics

The example demonstrates how the fps-meter could be required and how to access the data provided by the module.

Add Callback method and start logging

callbackId = fpsMeter.addCallback((fps, minFps) => {
        vm.set("fps", fps.toFixed(2));
        vm.set("minfps", minFps.toFixed(2));
});

fpsMeter.start();

Remove Callback method and stop logging

fpsMeter.removeCallback(callbackId);
fpsMeter.stop();

Improve this document

Demo Source


API Reference for the FPS Meter Class