Skip to content

griffin-lora/rbx-timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rbx-timeout

setTimeout and setInterval for roblox-ts.

Examples

Using rbx-timeout with setTimeout

import { setTimeout } from "rbx-timeout"
const timeout = setTimeout(() => {
    print("This will print in 1000 milliseconds (1 second).")
}, 1000)

Using rbx-timeout with clearTimeout

import { setTimeout, clearTimeout } from "rbx-timeout"
const timeout = setTimeout(() => {
    print("This will NOT print in 1000 milliseconds (1 second).")
}, 1000)
clearTimeout(timeout)

Using rbx-timeout with setInterval

import { setInterval } from "rbx-timeout"
const interval = setInterval(() => {
    print("This will continue to print every 1000 milliseconds.")
}, 1000)

Using rbx-timeout with clearInterval

import { setInterval, clearInterval } from "rbx-timeout"
const interval = setInterval(() => {
    print("This is now functionally equivalent to setTimeout.")
    clearInterval(interval)
}, 1000)

Using rbx-timeout with classes

import { Timeout } from "rbx-timeout"
const timeout = new Timeout(() => {
    print("This will not print")
}, 1000) // equivalent to setTimeout
timeout.clear() // equivalent to clearTimeout
import { Interval } from "rbx-timeout"
const interval = new Interval(() => {
    print("This will not print")
}, 1000) // equivalent to setInterval
interval.clear() // equivalent to clearInterval

About

setTimeout and setInterval for roblox-ts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published