Usually when you write a program, each line of code will be executed after one another. The speed and time to execute is depend on how complex the code. This method is called Synchronous where a line of code will be run until its finish. Once It finished, It will execute the next line of code. Therefore, It’ll take a long-running If the code in each line proceed an complex task after one another. However, There is an alternative method to solve this problem and promote time saving for developers.
Asynchronous is a method in parallel programming that execute code in any task simultaneously without have to wait for a task to finish and move to another task. This method will be beneficial If developer has multiple prominent line of code that must be executed in a short time. There are some programming languages that provides the asynchronous method. For Instance, Javascript provides a special command to run code all at once which are async, promise, await. Another way to declare asynchronous in Javascript is by using setTimeout(). Here are the Asynchronous example in Javascript
The image above show the Asynchronous with callback example. The setTimeout function with purpose to delay code execution. But this is just a simple review of Asynchronous.