Skip to main content

MasterClock

Master clock on the server

Functions

new

MasterClock.new(
remoteEventRemoteEvent,
remoteFunctionRemoteFunction
) → MasterClock

Constructs a new MasterClock

GetClockFunction

MasterClock:GetClockFunction() → function

Gets a function that can be used as a clock, like time and tick are.

ObservePing

MasterClock:ObservePing() → Observable<number>

Observes how much ping the clock has

IsSynced

MasterClock:IsSynced() → boolean

Returns true if the manager has synced with the server

GetPing

MasterClock:GetPing() → number

Returns estimated ping in seconds

GetTime

MasterClock:GetTime() → number

Returns the sycncronized time

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new MasterClock",
            "params": [
                {
                    "name": "remoteEvent",
                    "desc": "",
                    "lua_type": "RemoteEvent"
                },
                {
                    "name": "remoteFunction",
                    "desc": "",
                    "lua_type": "RemoteFunction"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "MasterClock"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 22,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "GetClockFunction",
            "desc": "Gets a function that can be used as a clock, like `time` and `tick` are.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "function"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 59,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "ObservePing",
            "desc": "Observes how much ping the clock has",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 68,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "IsSynced",
            "desc": "Returns true if the manager has synced with the server",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 76,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "GetPing",
            "desc": "Returns estimated ping in seconds",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 84,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        },
        {
            "name": "GetTime",
            "desc": "Returns the sycncronized time",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 92,
                "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "MasterClock",
    "desc": "Master clock on the server",
    "source": {
        "line": 5,
        "path": "src/timesyncservice/src/Shared/Clocks/MasterClock.lua"
    }
}