Yuari
Documentation
Docs/Timer/Stopwatch.new

Stopwatch.new

Creates a stopwatch object with Start, Stop and Reset methods.

Syntax

Stopwatch.new() -> any

Parameters

This function takes no parameters.

Returns

TypeDescription
anyThe value produced by the call.

Description

Stopwatch.new is part of the Timer library. Timer, Stopwatch and Duration objects driven by the VM scheduler.

Each call creates or returns a fresh object or value that you can store and pass to other functions.

Example

local stopwatch = Stopwatch.new()
stopwatch:Start()

Notes

  • Timer callbacks run on the executor scheduler; disable or destroy timers when they are finished.