FPS Display

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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.

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

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

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);
    });
})();