(JS) sleep

const sleep = (ms: number) => {
  return new Promise((resolve) => setTimeout(resolve, ms));
};