Skip to content

l0.DependencyControl.shims.PreciseTimer

PreciseTimer = require "l0.DependencyControl.shims.PreciseTimer"
local PreciseTimer = require("l0.DependencyControl.shims.PreciseTimer")

PreciseTimer

A monotonic stopwatch replicating the native PT.PreciseTimer API on top of the DependencyControl Timer engine.

Constructor

preciseTimer = PreciseTimer!
local preciseTimer = PreciseTimer()

Starts a new timer, capturing the current time as its start point.

Instance methods

timeElapsed

preciseTimer\timeElapsed!
preciseTimer:timeElapsed()

Returns the seconds elapsed since the timer was created.

Returns:

  • seconds number

Class methods

sleep

PreciseTimer.sleep ms
PreciseTimer.sleep(ms)

Sleeps for the given number of milliseconds.

param type description
ms? number milliseconds to sleep (defaults to 100)

Fields

field type description
version number
version_string string
loadedLibraryPath string