What is the purpose of setTimeout function? Technology Community › Category: Node.js › What is the purpose of setTimeout function? 0 Vote Up Vote Down 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.