Skip to main content

Profile

This item is only intended to be used by the module's authors. Private

Where a frame's time goes, for the plugin's benchmark (Performance > Run benchmark). Each part of the sea times itself with Profile.Add; every half second the averages per frame are written to the OceanSurface as Prof_<Name> attributes (milliseconds per frame), readable from anywhere with no require.

Two clock reads per timed section, and a handful of attribute writes a second: cheap enough to leave on.

Functions​

Add​

Profile.Add(
name: string,
started: number
) → ()

Adds the time since started (an os.clock() reading) to name's total for this interval.

Publish​

Profile.Publish(
model: Instance,
gauges: (() → {[string]: number})?
) → ()

Counts a frame, and once the interval is up writes every total as milliseconds per frame onto model. gauges (called only then) returns values measured elsewhere, already per frame.

Show raw api
{
    "functions": [
        {
            "name": "Add",
            "desc": "Adds the time since `started` (an os.clock() reading) to `name`'s total for this interval.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "started",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 23,
                "path": "src/Ocean/Profile.luau"
            }
        },
        {
            "name": "Publish",
            "desc": "Counts a frame, and once the interval is up writes every total as milliseconds per frame onto `model`.\n`gauges` (called only then) returns values measured elsewhere, already per frame.",
            "params": [
                {
                    "name": "model",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "gauges",
                    "desc": "",
                    "lua_type": "(() -> { [string]: number })?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 32,
                "path": "src/Ocean/Profile.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Profile",
    "desc": "Where a frame's time goes, for the plugin's benchmark (Performance > Run benchmark). Each part of the\nsea times itself with Profile.Add; every half second the averages per frame are written to the\nOceanSurface as `Prof_<Name>` attributes (milliseconds per frame), readable from anywhere with no require.\n\nTwo clock reads per timed section, and a handful of attribute writes a second: cheap enough to leave on.",
    "private": true,
    "source": {
        "line": 11,
        "path": "src/Ocean/Profile.luau"
    }
}