NativeScript Angular

Fps Meter

Logging frames-per-second statistics for your app requires the fps-meter module.


Import FPS Meter Module

import { Component, NgZone } from "@angular/core";
import { start, removeCallback, addCallback, stop } from "tns-core-modules/fps-meter";

    templateUrl: "./usage.component.html"
export class FpsMeterUsageComponent {
    public status = false;
    public callbackId;

    constructor(private zone: NgZone) { }

    startFPSMeter() {
        this.callbackId = addCallback((fps: number, minFps: number) => {
   => {
                console.log(`Frames per seconds: ${fps.toFixed(2)}`);

    stopFPSMeter() {

Improve this document

Demo Source


Name Type Description
addCallback(callback: function) number Adds a callback function to be called each time FPS data is due to be reported. Returns an unique id which can be used to remove this callback later.
removeCallback(id: number) any Removes the callback with the specified id.
running boolean Returns a valid indicating whether the frames-per-second meter is currently running.
start void Starts the frames-per-second meter.
stop void Stops the frames-per-second meter.

API References

Name Type
tns-core-modules/fps-meter Module

Native Component

Android iOS
android.view.Choreographer CADisplayLink