Check out example codes for "timeout typescript". It will help you in understanding the concepts better.

Code Example 1

setTimeout(() => {
                console.log('hi');
              }, 500);

Learn ReactJs, React Native from akashmittal.com