// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Five-sample timer check // Not compiled or tested in-world // Setup: Touch as owner to start or restart one short measurement run. // Stop / restore: Stops automatically after five samples. Removing the script also stops it. // Notes: Timer intervals are requests, not exact deadlines. This script measures its own scheduling and does not identify the cause of delays. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. integer samples; float total; default { touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; samples = 0; total = 0.0; llResetTime(); llSetTimerEvent(2.0); llOwnerSay("Measuring five timer intervals..."); } timer() { float elapsed = llGetAndResetTime(); total += elapsed; ++samples; llOwnerSay("Interval " + (string)samples + ": " + (string)elapsed + " seconds."); if (samples >= 5) { llSetTimerEvent(0.0); llOwnerSay("Mean interval: " + (string)(total / (float)samples) + " seconds."); } } changed(integer flags) { if (flags & CHANGED_OWNER) llResetScript(); } }