Skip to content

Time

The Time module provides sleep and delay functions for controlling program timing.

Methods

MethodReturnsDescription
Time.sleep(ms)voidSleep for the given milliseconds
Time.now()intCurrent time in milliseconds since epoch

Examples

wyn
// Sleep for 1 second
Time.sleep(1000)

// Sleep for 500ms
Time.sleep(500)

// Measure execution time
var start = Time.now()
// ... do work ...
var elapsed = Time.now() - start
println("Took " + elapsed.to_string() + "ms")

See Also

  • DateTime — timestamps, formatting, date arithmetic

See Also

MIT License