HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/matomo.vdk/plugins/TagManager/Template/Variable/TimeSinceLoadVariable.web.js
(function () {
    return function (parameters, TagManager) {
        this.get = function () {
            var unit = parameters.get('unit', 'ms');
            var now = new Date().getTime();
            var loadTime = TagManager.dataLayer.get('mtm.mtmScriptLoadedTime');
            if (!loadTime) {
                loadTime = TagManager.dataLayer.get('mtm.startTime');
            }
            if (!loadTime) {
                var win = parameters.window;
                if (TagManager.utils.isObject(win.performance) && win.performance.timing && win.performance.timing) {
                    loadTime = win.performance.timing.loadEventStart;
                }
            }
            if (!loadTime) {
                return;
            }
            if (unit === 's') {
                now = now / 1000;
                loadTime = loadTime / 1000;
            } else if (unit === 'm') {
                now = now / 1000 / 60;
                loadTime = loadTime / 1000 / 60;
            }

            return parseInt(Math.round(now - loadTime), 10);
        };
    };
})();