What is the purpose of setTimeout function?

Technology CommunityCategory: Node.jsWhat is the purpose of setTimeout function?
VietMX Staff asked 4 years ago

The setTimeout(cb, ms) global function is used to run callback cb after at least ms milliseconds. The actual delay depends on external factors like OS timer granularity and system load. A timer cannot span more than 24.8 days.