Timer Accelerator (Testing & Debugging Tool)

Speeds up client-side timers for development, testing, and educational purposes.

Від 31.03.2026. Дивіться остання версія.

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

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.

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

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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         Timer Accelerator (Testing & Debugging Tool)
// @namespace    https://github.com/hgcfkuyfliyfl/
// @version      2.1
// @description  Speeds up client-side timers for development, testing, and educational purposes.
// @author       Wisdom Ng'oma
// @license      MIT
// @match        *://*/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const SPEED_FACTOR = 100;
    let startTime = Date.now();
    let performanceStart = performance.now();

    // Override Date.now
    const originalDateNow = Date.now;
    Date.now = function() {
        return startTime + (originalDateNow() - startTime) * SPEED_FACTOR;
    };

    // Override performance.now
    const originalPerformanceNow = performance.now;
    performance.now = function() {
        return performanceStart + (originalPerformanceNow() - performanceStart) * SPEED_FACTOR;
    };

    // Override timers
    const originalSetTimeout = window.setTimeout;
    const originalSetInterval = window.setInterval;

    window.setTimeout = function(callback, delay, ...args) {
        return originalSetTimeout(callback, Math.max(1, delay / SPEED_FACTOR), ...args);
    };

    window.setInterval = function(callback, delay, ...args) {
        return originalSetInterval(callback, Math.max(1, delay / SPEED_FACTOR), ...args);
    };

    console.log(`Time Accelerator Active: ${SPEED_FACTOR}x`);
})();