FPS Display

Показывает количество кадров в секунду (FPS) в центре экрана сверху в игре Evades.io

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         FPS Display
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Показывает количество кадров в секунду (FPS) в центре экрана сверху в игре Evades.io
// @author       Remaster
// @match        https://evades.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var fpsCounter = document.createElement('div');
    fpsCounter.style.position = 'fixed';
    fpsCounter.style.top = '10px';
    fpsCounter.style.left = '50%';
    fpsCounter.style.transform = 'translateX(-50%)';
    fpsCounter.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
    fpsCounter.style.color = 'white';
    fpsCounter.style.padding = '5px';
    fpsCounter.style.zIndex = '9999';
    document.body.appendChild(fpsCounter);

    var frameCount = 0;

    function updateFPS() {
        frameCount++;
    }

    setInterval(function() {
        fpsCounter.textContent = 'FPS: ' + frameCount;
        frameCount = 0;
    }, 1000);

    requestAnimationFrame(function measure() {
        updateFPS();
        requestAnimationFrame(measure);
    });
})();